Sending Workflow Email IAM team with requester details in email - Missing variables in email

Hey all,

I am still learning workflows and the email part keeps challenging my knowledge. I am hoping i can get a bit of help to close this out with my manger.

The user case is as below: The user gets matches a “Job Title” for a role in Salesforce. I have to send an email to the IAM team hard coded email that tells them the user had an that account created in that source on that date and the role that was added,

I can get the name of the person with the below however i cannot figure out how to get the role data and the date variable in the email body so that the email sends the InfoMation to the IAM team

I am most likely over thinking this but if anyone has a lifeline i can use to close this week and last min request out i would be very grateful.

Body:

Hello,

A account for $name with $dept has been created in the Salesforce Development (UAT) application

Thank you,

The IAM Team


Templating Context

{“dept.$”:“$.getIdentity.jobTitle”,“name.$”:“$.getIdentity.name”}

@VBsupport To get the roles you can use the $.getAccess.accessItems.type which will bring the role, accessProfiles and entitlement. You can choose which one you want. If possible can you drop the WF json and what trigger you are using.

Thanks.

Thanks for looking

I am getting the email but it just not giving me the access role that is getting added on the create of the account. Here is the jason

{
“name”: “Salesforce Account create Notification”,
“description”: “”,
“modified”: “”,
“modifiedBy”: {
“type”: “IDENTITY”,
“id”: “XXXXXXXXXXX”,
“name”: “XXXXXXXXX”
},
“definition”: {
“start”: “Get Identity”,
“steps”: {
“End Step - Success”: {
“description”: “End Step - Success”,
“displayName”: “”,
“type”: “success”
},
“Get Access”: {
“actionId”: “sp:access:get”,
“attributes”: {
“accessprofiles”: false,
“entitlements”: false,
“getAccessBy”: “specificIdentity”,
“identityToReturn.$”: “$.trigger.recipient.id”,
“query”: null,
“roles”: true
},
“displayName”: “”,
“nextStep”: “Send Email”,
“type”: “action”,
“versionNumber”: 1
},
“Get Identity”: {
“actionId”: “sp:get-identity”,
“attributes”: {
“id.$”: “$.trigger.recipient.id”
},
“displayName”: “”,
“nextStep”: “Get Access”,
“type”: “action”,
“versionNumber”: 2
},
“Send Email”: {
“actionId”: “sp:send-email”,
“attributes”: {
“body”: “

Hello,

\n

<p>A account for $name withthe $dept job title has been created in the Salesforce Development (UAT) application</p>

\n

Access:

\n

The Access Granted is as below

\n

${access}

\n

‘${requestItemName}’

\n

Thank you,

\n

The IAM Team

\n

 

\n

 

\n

 

”,
“context”: {
“access.$”: “$.getAccess.accessItems”,
“dept.$”: “$.getIdentity.attributes.jobTitle”,
“name.$”: “$.getIdentity.name”
},
“from”: “[email protected]”,
“recipientEmailList”: [
[email protected]
],
“replyTo”: null,
“subject”: "New Account Created for Salesforce "
},
“displayName”: “”,
“nextStep”: “End Step - Success”,
“type”: “action”,
“versionNumber”: 2
}
}
},
“creator”: {
“type”: “IDENTITY”,
“id”: “XXXXXXXXX”
},
“trigger”: {
“type”: “EVENT”,
“attributes”: {
“filter.$”: “$.accountRequests[?(@.accountOperation == "Create" && (@.provisioningResult == "SUCCESS" || @.provisioningResult == "committed") && @.source.id == "2b3875717c024eeda502f48486862bf3")]”,
“id”: “idn:post-provisioning”
}
}
}

This is the email i am getting

Hi @VBsupport,

If you are trying to send the access that was added as part of the provisioning, you can directly get the value from the trigger output (Assuming that you are using a provisioning completed trigger).

Try something as below in the email context and see if it works for you.

"access.$":"$.trigger.accountRequests[?(@.source.id == "2b3875717c024eeda502f48486862bf3")].attributeRequests[?(@.operation == "Create")].attributeValue"

The Get Access action may not work for you as it will fetch the entire access list of the user.

For getting the time/date in the email, you can use a define variable operator and use a “$.now()” variable. Reference

1 Like

Have you tried using the email template:

No need for a workflow

I just need it for one source and now for everyone one so i think this would not work,

I will try this, but I also added a wait time which seas to be catching it now, ’

the question i have would your statement in the email remove all the noise in the request output to just give me the name,
I am not the greatest with the velocity email formatting yet

Yes, it is expected to populate only the attribute value in your email.

@VBsupport Did you try this in context? I hope this might helpful

"access.$”: “$.getAccess.accessItems.name