Compare String step in Workflow returns false everytime

I have defined a workflow to send out on email notification for every revoke decision made during a certification campaign. I am using the “Certification Signed Off” trigger and then the HTTP Request action to get the list of all access review decisions. In the next step I am using the “Compare Strings” operator to send out the email only if a particular entitlement is part of the campaign.

The workflow works fine when the access reviewer only has one identity to review but, when there are multiple identities to review the workflow executes and the Compare String step returns false everytime and ends the workflow. I am not sure what I am doing wrong here:

Check the execution logs when the HTTP Request step has multiple identities compared to a single identity. What I assume is happening is that with multiple results, Value 1 (Compare String 1) is an array which will not compare to the string. When there is only 1 result, Value 1 (Compare String 1) is a string.

1 Like

Hello Edward,

You’re right! I just checked the output from the execution report in the JSON path evaluator tool and see that the output for Value 1 is an array when there are multiple identities involved:

What would you suggest I do here? The certification signed off trigger would get triggered after every certification and I need to make sure that emails are sent out only when a particular entitlement is bring reviewed. I am facing the same issue in the next step too where I am filtering out only the “Revoke” decisions using the Compare String operator.

you can loop through the array for each identity decision and then choose to send an email for each revoke decision depending upon your filter

Hello Nilesh. Apologies for the delay in response. I tried using the loop operator as suggested but my workflow still fails to send an email notification when multiple decisions are involved. This is how my workflow is currently defined:



It works fine when the access review only has one REVOKE decision but fails if there are multiple decisions involved.

Hi @mwh1424

Can you make these changes and then test it?

Set both the Loop Input and Context as $.hTTPRequest.body
Set the Compare Strings value 1 as $.loop.loopInput.identitySummary.decision and
value 2 as REVOKE

Let me know whether it works.

Thanks

Hello @nhassan

I have made the changes you’ve suggested but I do not see any email notifications.


Hi @mwh1424
Try this i.e set the Compare Strings value 1 as $.loop.loopInput.decision and
value 2 as REVOKE

Hi @mwh1424

You can try the attached JSON code for the workflow. I haven’t tested it yet.

If still there’s a problem then I will take a look into it tomorrow.
Sending Email for Every Revoke Decision.json (3.0 KB)

Hello @nhassan

Adding the Compare String value 1 as $.loop.loopInput.decision made the difference. It is now working as expected. I am receiving email notifications for every revoke decision.

Thank you for the help!

Is there also a way I could filter the trigger for this workflow so it only gets triggered when the Certification name has “Contingent Worker” in it? Right now it is getting trigger after every certification has been signed off. I would only like it to trigger the workflow when the name has “Contingent Worker” mentioned.

My current trigger is : $.certification[?(@.phase == “SIGNED”)]

Hi @mwh1424

Here’s the working filter as I’ve tested it and seems to be working fine.

$.certification.campaignRef[?(@.name contains "Contingent Worker")] as long as the name contains “Contingent Worker” anywhere in the name.

There’s no need to add @.phase == "SIGNED" in the filter as the 'Certification Signed Off" trigger itself represents all signed off certifications.

Give it a try and let me know if you need more help or you can mark this post as “Solution”.

1 Like

Hello @nhassan

That worked. Thank you for all the help here. I have marked the previous reply as the solution as that was the actual issue.