Skip to main content

system.mes.location.getPropertyValueFor

Description

Retrieves a Location Property Values record by its location ID or path and by its property ID or name.

Syntax

system.mes.location.getPropertyValueFor(locationIdOrPath, propertyIdOrName)

Parameters

ParameterTypeDescription
locationIdOrPathStringThe ULID or path of the location.
propertyIdOrNameStringThe ULID or name of the property for which the value is retrieved.

Returns

Returns a JSON representation of the location property value. Returns nothing if no location property value is found.

NameTypeDescription
locationIdString (ULID)The ULID of the location.
propertyIdString (ULID)The ULID of the location property.
dataTypeStringThe data type of the property value. Must be the same as the data type of the property.
valueMixedThe value assigned to the property value if none is provided. The type is mixed as it depends on what dataType is.
idString (ULID)The ULID of the location property value.
notesStringNotes related to the location property value.
enabledBooleanIndicates if the property value is active and enabled.
spare1StringAdditional field for user-defined context.
spare2StringAdditional field for user-defined context.
spare3StringAdditional field for user-defined context.

Code Examples

# Retrieve a location property value by location ID or path and property ID or name
property_value = system.mes.location.getPropertyValueFor('DairyCo', 'Cows')

# Output the location property value
print(property_value)