I have a requirement in NERM where the manager’s department value needs to be assigned to the NERM user. Department value is not present in NERM, so the value should be fetched from ISC.
When the Sponsor name is selected in the NERM form, the Textbox field should populate the department of the sponsor fetched from ISC.
That will pick up just the email from the user account that you selected as the sponsor.
Another option is to sync all your optional sponsors as a profile as well and keep the data in NERM. This, however, might be a bit too much, but depends on the use case you have.
The sponsor value format is John Smith (john.smith@company.com) — the email is always between ( and ). In a NERM workflow Script step you can extract it like this:
var sponsor = $.sponsor; // e.g. "John Smith (john.smith@company.com)"
var email = sponsor.substring(sponsor.indexOf('(') + 1, sponsor.indexOf(')'));
return email; // john.smith@company.com
Then pass that email variable into your REST call query string.
attribute: pulls attribute values from the current workflow session
sponsor: references the specific attribute. This is the UID of the attribute, so could be sponsor, sponsor_ne_attribute, sponsor_contributor_select, etc… whatever the UID was set to when the tenant was configured.
email: this is the value from the attribute we want to take. Since Sponsor is a Contributor Select / user object, we can pull the id, name, email, or login from it
So, if the value of “sponsor” was John Smith (john.smith@company.com) , the above liquid would return just john.smith@company.com - resulting in a body like:
Thank you so much for sharing your suggestions and it worked for me. I need one more help on REST API side. While I added the REST API action , Workflow is getting failed and it seems misconfiguration of API steps.
Please help to resolve this issue to meet my deadlines.
What is the error message in the Workflow session?
If its a 401 - With OAuth2, I’m fairly certain you do not need to enter an Authorization header. The Authentication steps preceding the call will generate the token and utilize that in the background.