- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-02-2024 02:03 AM
Hell Everyone,
I am trying to populate a 4 variables on the email body in approval notification.
I created a Approval email notification on sysapproval_approver table. and i have a catalog item with 4 variables like "First Name, Last Name, Email Id, Type of Access. I want to populate these variables on the email body.
I created a email script for this.
email script: servicenow_access_varibles_on_approval
${sys_created_by}'s request is awaiting for your approval |
Hello ${approver}, |
${sys_created_by} has submitted a ${document_id} and awaiting for your approval. |
${mailto:mailto.btn.approval} ${mailto:mailto.btn.rejection} |
Thanks,
Team
I tried this but i am not able to populate variables. It is showing undefined.
First Name: undefined
Last Name: undefined
Email ID: undefined
Type of Access: undefined
Can any one please help me out this.
Thanks,
Shareef
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-02-2024 06:41 AM
Hello @shareef_223
You can access variables of the request item without needing to write any code in the email script.
Please paste the below code into the notification body:
${document_id.variables.first_name}
Let me know if you need further clarification or assistance.
If I could help you with your Query then, please hit the Thumb Icon and mark as Correct!!
thank you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2024 02:47 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2024 02:59 AM
You're welcome @shareef_223 I'm glad to hear that you were able to get the variables in your email.
If you have any more questions or need further assistance, feel free to ask!
Thanks,
Abhijeet.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-20-2024 12:01 AM
Hello @Abhijeet_Pawar
I tried this and now I able to get the variables on the email.
And I have a request here where we have a variable (check box) it contains more than 40 options, How can I get them in email notification.
For ex: What is your state and it is having 30 options but I have to populate the selected option in the email over "What is your state" field.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-07-2025 04:45 AM
Saved so much time brother , thanks