Skip to main content

system.mes.location.getLocationPropertyValues

Description

Retrieves a list of all Location Property Values records for a given location.

Syntax

system.mes.location.getLocationPropertyValues(locationIdOrPath)

Parameters

ParameterTypeDescription
locationIdOrPathStringThe ID or path of the location to retrieve property values for.

Returns

Returns a list of JSON objects representing all property values for the specified location.

Each object in the list has the following properties:

NameTypeDescription
locationIdString (ULID)The ULID of the location this property value belongs to.
propertyIdString (ULID)The ULID of the property this value is for.
valueObjectThe actual value of the property (type depends on the property's dataType).
dataTypeStringThe data type of the property value.
idString (ULID)The ULID of the location property value.
notesStringNotes related to the 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 all property values for a specific location
propertyValues = system.mes.location.getLocationPropertyValues('DariyCo/Plant1')

# Output the number of property values
print("Found {0} property values for this location".format(len(propertyValues)))

# Loop through each property value and print its name and value
for propValue in propertyValues:
print("Property: {0}, Value: {1}".format(propValue['propertyName'], propValue['value']))