Issue with NERM liquid template engine

What problem are you observing?

We are using liquid templating to render the changes for a particular profile so that the approver of a workflow better understands what updates have been shown. Example code:

  if profile.first_name != attribute.first_name
    assign noChange = false
    echo 'First name changes: '
    if profile.first_name
      echo profile.first_name
    else
      echo 'none'
    endif
  endif

This code is comparing the value currently on the profile (profile.first_name) with the value that is in this workflow session (attribute.first_name). This works fine in the following scenarios:

  1. profile.first_name and attribute.first_name both have a value
  2. profile.first_name is currently empty and attribute.first_name now has a value

If however profile.first_name has a value and attribute.first_name is cleared out in the previous step, the liquid templating renders attribute.first_name with the value it previously had (i.e. equal to profile.first_name)

What is the correct behavior?

We expect attribute.first_name to always display the value currently in the workflow session. I.e. blank / null if the value is empty or just displaying the value it has.

What product feature is this related to?

This is related to NERM liquid templates.

What are the steps to reproduce the issue?

Create a paragraph text section in an approval form, with the code above. Optionally include something like:

echo 'attribute value = ['
echo attribute.first_name
echo ']'

Have an update workflow where you can change values on an attribute that is not required. Ensure the attribute (first_name in this example) has a value when starting the workflow. Then remove the value in the request form. In the approval form it will show that attribute.first_name is empty. If you just change the value and not empty it, it will show up with a value.

Do you have any other information about your environment that may help?

N/A

Hi Edwin,

This is expected behavior: Liquid Template language use in NERM

The attribute syntax will pull values from the Workflow Session / Request first - and if none are available, it will attempt to then pull a value from the Profile.

If you want to only grab a value from the request, use the request syntax: request.first_name

Great thanks, I will check and see if this works (pretty sure that it does). And I will bookmark that post for sure.

However, I think this (and other things) need to be included in the actual documentation of NERM. Requiring someone to search in the developer forums to find something like this seems like a big oversight.