Happy Business Starts Here

Support SME

“Undefined variable ID” error

Question:

 

Some of our Workflows are throwing the error “undefined variable ID”, but this only happens sporadically, so we have no idea what is causing this issue.






If you found my answer helpful, please give me a kudo ↑
Help others find answers faster by accepting my post as a solution √

2 REPLIES 2
Support SME

Re: “Undefined variable ID” error

Solution:

 

Given the error "Data Error: Undefined variable Id", it looks like an issue with the IF task config. It's looking for the field 'Id', but if the response is blank, it fails because the task cannot find that field.

 

There are two ways the IF task can be used if you are trying to route the data given an active subscription for example.

 

You can check if the response is not blank since the query condition states if the subscription is 'Active'.

 

Example:

{% if Data.Subscription[0] != blank %}
True

{% else %} False {% endif %}

You can also include Status as a field in the query and check for the status.

 

Example:

{% if Data.Subscription[0].Status == 'Active' %} True {% else %}
False

{% endif %}

 






If you found my answer helpful, please give me a kudo ↑
Help others find answers faster by accepting my post as a solution √

Senior Tutor

Re: “Undefined variable ID” error

This will happen if the account you've queried has no subscriptions.