Workflow to send email after an account Creation

Hello,

We are trying to create Workflows to send an email to the user when a new account is created by IdentityNow for him in a source, so that we can send him the details to access the system.

I have created for this a workflow with Provisioning Completed trigger and the following filter :
‘$[?($.accountRequests[0].source.name == “Source Name” && $.accountRequests[0].accountOperation == “Create” && $.accountRequests[0].provisioningResult == “SUCCESS” )]’

But we are never entering the workflow, I cannot understand why.
Any idea ?

Regards

Have you checked your JSON input from the Workflow? It’s possible that the trigger returns more than one account requests and maybe the [0]th one isn’t the Create operation on the source that you are comparing to.

If you remove this filter, are you able to execute the workflow?

Try this filter:

$.accountRequests[?(@.source.name == “Source Name” && @.accountOperation == “Create” && @.provisioningResult == “SUCCESS”)]

Yes i’ve check using documentation and also tried to run the workflow without filter. You were right there is multiple element in accountRequest.

$.accountRequests[?(@.source.name == “Source Name” && @.accountOperation == “Create” && @.provisioningResult == “SUCCESS”)]

This filter is not accepted in the trigger block.Maybe i should use the loop block to go through the accountRequests attribute ?

Regards

What is the error you are getting?

This filter works for me.

Make sure when you copy paste it, replace the quotes/white spaces.

Wow, it was tricky to view that the quotes were not the same.
But as of now, the workflow is not started when doing a create account.

I am creating a similar workflow, and it is not trigger for me either when the account is being created. I also changed fixed the formatting it still isn’t working.

Do you have a JSON file that we can use?

No, I don’t have one for this trigger.

Try using the documentation here to test your filter.

Is there a reason the filter wouldn’t work for us, but only for you?

I didn’t execute it, i just verified the JSON expression didn’t have any error.

Oh I see so you recommend finding one that works!

Hi Alexandre,

We did a similar workflow using the following trigger (code comes from the JSON directly) :

"trigger": {
		"type": "EVENT",
		"attributes": {
			"filter.$": "$.accountRequests[?(@.accountOperation == \"Create\" && @.provisioningResult ==\"committed\" && (@.provisioningTarget ==\"NAME OF YOUR SOURCE A\" || @.provisioningTarget ==\"NAME OF YOUR SOURCE B\" ))]",
			"id": "idn:post-provisioning"
		}
	}

Hello Thibault,

Thanks for your answer ! I have done a test and it works !
Huge thanks to all of you for your help.