Script repository

Send multi-valued property values via email

Updated on: Jan 18, 2026, Views: 1736

Miscellaneous

The script sends an email notification containing all values of a multi-valued property. To execute the script, create a business rule, custom command or scheduled task configured for the required object type.

Parameters

  • $propertyName - the name of the property whose values will be included into the email notification.
  • $to - the email address of the notification recipient.
  • $subject - the email notification subject.
  • $messageTemplate - a template of the email notification. In the template, the {0} placeholder will be replaced with values of the property specified in the $propertyName variable.
$propertyName = "adm-CustomAttributeTextMultiValue1" # TODO: modify me

# Email settings
$to = "recipeint@domain.com" # TODO: modify me
$subject = "Values of '$propertyName' property" # TODO: modify me
$messageTemplate = "Values: {0}" # TODO: modify me

# Get property values.
try
{
    $values = $Context.TargetObject.GetEx($propertyName)
}
catch
{
    $values = $NULL
}

if ($values -eq $NULL)
{
    $values = "Not specified"
}
else
{
    $values = [System.String]::Join("; ", $values)
}

# Build message
$message = [System.String]::Format($messageTemplate, $values)

# Send mail
$Context.SendMail($to, $subject, $message, $NULL)

Comments 0

You must be signed in to comment.

    Got questions?

    Support Questions & Answers

    We use cookies to improve your experience.
    By your continued use of this site you accept such use.
    For more details please see our privacy policy and cookies policy.