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:
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
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.