Skip to main content
All CollectionsAutomationFunctions
SetTerritoryMetric() & SetTerritoryColor() Functions
SetTerritoryMetric() & SetTerritoryColor() Functions

Update territory metrics and colors dynamically

Alex avatar
Written by Alex
Updated this week

SetTerritoryMetric(territoryCode, metricCode, newValue) - updates a single metric in a territory. This takes effect immediately.

SetTerritoryColor(territoryCode, newColor) - set a new color to the territory. This takes effect immediately.

Input

territoryCode - This is the code of the specific territory, which can be found in the table view via the “Territories Codes” system object when territories have been created. It’s generated automatically when a name is assigned to a territory.

Note: You can also retrieve the territory codes programmatically using the GetTerritories() function.​

metricCode - The code of the metric, which can be found in the territory creation modal.


newValue - The new value to be assigned.

newColor - The new color to be assigned, which can be specified in the following formats:
HEX: #ffffff

RGB: 255,255,255

Color name (according to W3C): red, blue, black

Usage

These functions can be called within any actions, buttons, or workflows. They are available in any expression builder.

Examples

SetTerritoryColor()

SetTerritoryMetric()

See also:

Did this answer your question?