Identity Attribute Changed Trigger JSONpath to check if multiple attributes have changed

Hi Team,

I am tring to create a workflow which triggers based on the below conditon:
[Department and Title ] or [Department and location] - Whenever i try to use &&,|| the workflow says that is an invalid json path. Did someone have a similar scenario and appriciate your feedback if any.


1 Like

You can try these

$.changes[?((@.attribute == “cloudLifecycleState” || @.attribute == “department”) || (@.attribute == “cloudLifecycleState” && @.attribute == “location”))]

Thanks for the response, I tried this aswell but it says supplied trigger invalid.Also, i tried just - $.changes[?((@.attribute == “cloudLifecycleState” && @.attribute == “department”) and the workflow is not working properly if that is ‘And’ operation and working fine if that is ‘OR’ operation.


I believe that when you do what Krishna suggested it will take a look at attribute x and check if it is department, which might be true but then when you have an &&, it will take a look at attribute x again and see that it is not cloudLifecycleState, because it is attribute x+1 in the array that is cloudLifecycleState instead. I.e. looking at same value.

Perhaps it is possible to do something like this:

$[?(("department" in @.changes[*].attribute && "title" in @.changes[*].attribute) || ("department" in @.changes[*].attribute && "location" in @.changes[*].attribute))]

Check if your attributes exists in the whole changes instead of just looking at the current attribute being looped over. Hope it works.

1 Like

Hi @jeseri thankyou, the filter you povided is working as expected.


This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.