Trigger Filter for Native Change detection Updated Workflow

Hi All,

I’m trying to create a trigger filter like $.entitlementChanges[*].added[?(@.id == “1234567”].id totrigger a workflow for a specific entitlment addition, I’m able to get the result as [
“1234567”
]

is there a way we can achieve to get only the id without square brackets and double quotes so it matches the exact id and triggers workflow. Thanks in advance.
{
“input”: {
“identity”: {
“uid”: “—”,
“manager”: null,
“name”: “—”,
“alias”: “—”,
“id”: “—”,
“type”: “IDENTITY”,
“email”: “—”
},
“singleValueAttributeChanges”: ,
“entitlementChanges”: [
{
“removed”: ,
“added”: [
{
“owner”: null,
“name”: “ENT NAME”,
“id”: “1234567”,
“value”: “ENT VALUE”
}
{
“owner”: null,
“name”: “ENT NAME 1”,
“id”: “12345678”,
“value”: “ENT VALUE 2”
}
],
“attributeName”: “memberOf”
}
],
“eventType”: “ACCOUNT_UPDATED”,
“source”: {
“owner”: {
“name”: “—”,
“id”: “—”,
“type”: “IDENTITY”,
“email”: “—”
},
“name”: “Active Directory”,
“alias”: “Active Directory [source]”,
“id”: “1234567890”,
“type”: “SOURCE”,
“governanceGroup”: null
},
“accountChangeTypes”: [
“ENTITLEMENTS_ADDED”
],
“multiValueAttributeChanges”: ,
“account”: {
“name”: “—”,
“id”: “123456723534636”,
“type”: “ACCOUNT”,
“uuid”: “{86ea-465d-bdc9-c1b0ff7c9efe}”,
“correlated”: true,
“nativeIdentity”: “CN=—,OU=—,OU=–”
}
}
}

I usually leverage a JSONPath expression builder there are many free resources that help such as this: JSONPath Online Evaluator
Wherein you can practice and hon your JSONPath building skills.
And try adding the below path not sure if it would work because the JSON body you have shared seems to have errors:

$.input.entitlementChanges[0].added[0].id

1 Like

Hi Aman,

Thanks for the response.

sorry if there are error in the json, but what I’m trying to achieve is to match a specific entitlement id and trigger a WF.

$.input.entitlementChanges[0].added[0].id is only giving me the first added entitlement. I want to filter out only one out of few added entitlements without square brackets and double quotes…just the id value. thanks

Hey , Try using a filter similar to this

$.entitlementChanges[*].added[?(@.id=="YOUR ID")]

best!

Hi Ivan,

its giving me json result like this [“xxx”], but i only need value not the square brackets and ".

try this :

$.entitlementChanges[*].added[?(@.id=="YOUR ID")].id

Hi @Prashanth1812,

What is your use case here.? If you are filtering the WF only for a specific entitlement, you already know which entitlement ID it is holding.

You can use a define variable operator and pass the value as a text and use it as a string.

And to trigger a WF, a filter as below should be enough.

$.entitlementChanges[*].added[?(@.id == "1234567"]

Note: if you are using the Test functionality, it will anyway trigger the WF and you may need to do an actual native change to test the filter condition.

Hi @jesvin90,

Thanks for the response, I will test this and update here if it works.

No luck, Ivan same result. I have tried this already.

$.trigger.accountRequests[0].attributeRequests[?(@.attributeValue == “Ent1”)].attributeValue in compare String is working for me

Thanks @jesvin90 for the help.