Happy Business Starts Here

Re: Liquid variables across tasks

Highlighted
New Student

Liquid variables across tasks

I am creating a workflow to iterate over InvoiceItems related to each Invoice in Draft state so that I can do some specific calculations and adjustments.

 

I create a liquid variable after my Invoice iteration and set an initial value.

I then want to access that variable in an if task later in the workflow after the InvoiceItem iteration but the validation complains that the Liquid variable is undefined.

I am trying to access it like this {% if Data.Liquid.variable > 0 %}...

 

However I can access the variable without problems further in the workflow via the custom option in a CRUD update.

 

Does anyone know how to work with liquid variables across the workflow or point me to any documentation or sample liquid code?  I haven't been able to find anything in any of the documentation.

 

Thanks for any assistance anyone can provide.

7 REPLIES 7
Highlighted
Valued Scholar

Re: Liquid variables across tasks

Honestly, it's just a bug in the UI. If you know you are putting in the right name, click the 'Skip Validation' checkbox; I do it all the time.

Highlighted
Master

Re: Liquid variables across tasks

Old thread but just want to add my observations to anyone who runs into these validation errors while using liquid variables - 

 

1) while using liquid variables across the downstream tasks in a workflow click the checkbox to "skip the validation". 

 

2) Use Swimlane on the tasks to debug and test the liquid variables. 

 

3) If using liquid variables inside an "Email" task, then check the "Disable Editor"

 

Tags (2)
Highlighted
Valued Scholar

Re: Liquid variables across tasks


@jastorino wrote:

I create a liquid variable after my Invoice iteration and set an initial value.


How did you do that? Did you use the JSONTransform activity?

Master

Re: Liquid variables across tasks

use the assign liquid tag

 

{% assign my_variable = 'the value' %}

 

 

Highlighted
Valued Scholar

Re: Liquid variables across tasks


@gauri wrote:

use the assign liquid tag

 

{% assign my_variable = 'the value' %}

 

 


So, this should be done in the 'Liquid' activity provided by Workflow, correct?

Highlighted
Master

Re: Liquid variables across tasks

yes, if you want to access the variable across tasks.

 

assign tag saves the value in the payload under the Liquid key. 

Highlighted
Valued Scholar

Re: Liquid variables across tasks

Thanks, @gauri