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.

Script repository

Check combination of property values

November 14, 2025 Views: 1901
The script checks whether the value of one property matches the value allowed for another property. For example, using the script, you can check whether a city and a country can be used together. The script should be executed in the If PowerShell script returns true condition in a business rule triggering Before updating an object. If the property values do not match, the script returns true.

Parameters:

  • $firstPropertyName - Specifies the schema name of the first property to check.
  • $secondPropertyName - Specifies the schema name of the second property to check.
  • $propertyMap - Maps values of the first property with values of the second property. The script returns TRUE if values of the properties do not match the mapping.
Edit Remove
PowerShell
$firstPropertyName = "c" # TODO: modify me
$secondPropertyName = "l" # TODO: modify me

$propertyMap = @{
    "US" = "Washington", "New York", "Boston";
    "FR" = "Paris", "Marseilles", "Lyon";
} # TODO: modify me

# Get first property value.
$value1 = $Context.GetModifiedPropertyValue($firstPropertyName)

if ([System.String]::IsNullOrEmpty($value1))
{
    $Context.ConditionIsMet = $False
    return 
}

# Get second property value.
$value2 = $Context.GetModifiedPropertyValue($secondPropertyName)

# Check values
$Context.ConditionIsMet = $propertyMap[$value1] -notcontains $value2
Comments 0
Leave a comment
Loading...

Got questions?

Support Questions & Answers