Fetches the value of a workflow form list field
To get the value of a list field contained in a workflow form, use the
getEntityRelationshipValue
method and enter the following parameters: the ID #
of the entity to which the form belongs, the ID # of the relationship with the
list-of-values entity, and the ID # of the attribute of the list-of-values
entity.
The code for that would be:
getEntityRelationshipValue("entity_ID #", "relationship_ID #", "list_of_values_entity_attribute_ID #")
Below is an example of how to fetch the value of a list field:
$value = $workflow_api->getEntityRelationshipValue("ENT01", "RelationshipID", "nmtext");
In this example, the getEntityRelationshipValue
method is fetching the value
of the attribute identified as nmtext in the list-of-values entity of the
relationship identified as "RelationshipID" in the entity identified as
"ENT01".
The returned value will be a string representing the value of the list field.
It is important to remember that the identifiers of the entity, of the relationship, and of the attribute of the list-of-values entity must be provided correctly in order for the method to work properly and return the expected value. Additionally, we recommended checking whether the entity, the relationship, and the attribute exist and are properly configured before fetching their value.