Workflow with multiple recipients in a send email action

Anyone know the trick to insert more than one recipient in a send mail action when they are defined as variables?

"Send Email": {
	"actionId": "sp:send-email",
	"attributes": {
		"context": {},
		"recipientEmailList.$": "$.defineVariable2.myRecipient"
	},
	"displayName": "",
	"nextStep": "End Step - Failure",
	"type": "action",
	"versionNumber": 2
}

something like this

“recipientEmailList”: [
“$.defineVariable2.myRecipient”,
“$.defineVariable3.myRecipient”,
“$.defineVariable4.myRecipient”

				]

The product casts the array as a string and tries to expand the result as variable, but obviously that is not possible.

Looking at posts from a few years ago, it was not possible then, I hoped something had changed.

Try something like this

"recipientEmailList": [
{{"$.defineVariable2.myRecipient"}},
{{"$.defineVariable3.myRecipient"}}, 
{{"$.defineVariable4.myRecipient"}}
]

Hope this helps you.

Hi,
Unfortunately that is not valid JSON, I gather you meant to have the curly braces inside quotes.

However, it looks like the product takes the value (regardless of the type) and casts it to a string.

Define a variable and use that in the email recipients.

Example:

"Define Variable": {
				"actionId": "sp:define-variable",
				"attributes": {
					"id": "sp:define-variable",
					"variables": [
						{
							"description": "",
							"name": "emails",
							"transforms": [],
							"variableA": "[{{$.getIdentity.attributes.email}},{{$.defineVariable1.appOwner}},admins@company.com]"
						}
					]
				},
				"displayName": "",
				"nextStep": "Send Email",
				"type": "Mutation"
			},
			"Send Email": {
				"actionId": "sp:send-email",
				"attributes": {
					"context": {},
					"recipientEmailList.$": "$.defineVariable.emails",
					"replyTo": ""
				},
				"displayName": "",
				"nextStep": "End Step - Success",
				"type": "action",
				"versionNumber": 2
			}

@kalyan_dev32

Hello Pavan ,
Just wanted to know did this worked for you ? When I tried to do the similar , the define variable returned a string object , which recipientEmailList couldn’t parse .

yes, it worked for me.

Test12320250507.json (1.5 KB)

1 Like

@kalyan_dev32

Yeah!! It is working!!
I thought

recipientList:"["mail","mail"]"

Wouldn’t work , as when we select multiple identities for recipientList it would be list

recipientList : ["mail","mail"]

Good Catch :sailpoint: !!!

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