system.mes.location.setPropertyValue
Description
Updates the value of a Location Property Values record given a location ID or path and a property ID or name.
Permissions
This method requires the LOCATION.WRITE.SAVE permission.
Syntax
system.mes.location.setPropertyValue(locationIdOrPath, propertyIdOrName, value)
Parameters
| Parameter | Type | Nullable | Description |
|---|---|---|---|
locationIdOrPath | String | False | The ULID or path of the location. |
propertyIdOrName | String | False | The ULID or name of the property for which the value is retrieved. |
value | Mixed | True | The value assigned to the property. The type is mixed as it depends on the data type of the property. May be None to clear the value, but only when the property definition is nullable; passing None for a non-nullable property raises an error. |
Returns
Returns a JSON representation of the updated location property value.
Code Examples
# Update the value of a location property value
updatedPropertyValue = system.mes.location.setPropertyValue('DairyCo', 'Cows', 200)
# Output the JSON representation of the updated location property value
print(updatedPropertyValue)
# Clear the value of a nullable property by passing None
system.mes.location.setPropertyValue('DairyCo', 'Cows', None)