Skip to main content
Version: 2.2.2

Fetches the value of a workflow form field

To get the value of a workflow form field, use the getEntityAttributeValue method and enter the following parameters: the ID # of the entity to which the form belongs, and the entity attribute ID #.

The code for that would be:

getEntityAttributeValue("entity_ID #", "entity_attribute_ID #")

Examples​

1. Boolean-type attribute​

$value = $workflow_api->getEntityAttributeValue("ENT01", "fgboolean");

In this example, the getEntityAttributeValue method is fetching the value of the attribute identified as "fgboolean" in the entity identified as "ENT01".

The returned value can be 1 or 0, indicating whether the field is checked or unchecked, respectively.

2. Time-type attribute​

$value = $workflow_api->getEntityAttributeValue("ENT01","hrtime");

In this example, the getEntityAttributeValue method is fetching the value of the attribute identified as "hrtime" in the entity identified as "ENT01".

The returned value will be a string in the "HH:MM" format (e.g.: 08:00), representing the time of the attribute.

3. Integer-type attribute​

$value = $workflow_api->getEntityAttributeValue("ENT01","vlinteger");

In this example, the getEntityAttributeValue method is fetching the value of the attribute identified as "vlinteger" in the entity identified as "ENT01".

The returned value will be an integer (e.g.: 123456) representing the value of the attribute.

4. Text-type attribute​

$value = $workflow_api->getEntityAttributeValue("ENT01","nmtext");

In this example, the getEntityAttributeValue method is fetching the value of the attribute identified as "nmtext" in the entity identified as "ENT01".

The returned value will be a string (e.g.: ABC) representing the value of the attribute.

5. Date-type attribute​

$value = $workflow_api->getEntityAttributeValue("ENT01","dtdate");

In this example, the getEntityAttributeValue method is fetching the value of the attribute identified as "dtdate" in the entity identified as "ENT01".

The returned value will be a string in the "YYYY-MM-DD"_ format (1999-01-01)_, representing the date of the attribute.

6. Decimal-type attribute​

$value = $workflow_api->getEntityAttributeValue("ENT01","vlnumber");

In this example, the getEntityAttributeValue method is fetching the value of the attribute identified as "vlnumber" in the entity identified as "ENT01".

The returned value will be a decimal number (e.g.:1234.56000000), representing the value of the attribute. It is possible for the value to contain trailing zeros because the returned value maintains the precision defined for the attribute.

caution

It is important to remember that the entity ID # and the entity attribute ID # must be provided correctly in order for the method to work properly and return the expected value. Additionally, we recommended checking whether the entity and attribute exist and are properly configured before fetching their value.