How to get record producer variables values into email script?

Murali16
Kilo Contributor

How to get record producer variables values into email script?

Let me explain in detail. I had 4 variables on my record producer, I need to use that variables values in my email notifications.

6 REPLIES 6

Ankur Bawiskar
Tera Patron
Tera Patron

Hi Murali,

email notification is on which table. I assume it would be on the target table of the record producer

Regards

Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

Hi Ankur,

Yes email notification and Record Producer are in same table.

Regards,

Murali.

Hi there,

Within email script you have current available. So you could just just current.variables.your_variable.

If my answer helped you in any way, please then mark it as helpful.

Kind regards,
Mark
2020 ServiceNow Community MVP
2020 ServiceNow Developer MVP

---

LinkedIn
Community article list

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

LinkedIn

Tanaji Patil
Tera Guru

You might have mapped these 4 variables values to one of the fields of your target table.
Lets assume this record producer is for incident creation.
So trigger you email when an incident is created and include the fields in your email which you used in record producer mapping.

Another option is to create a JSON (or any other string format) form the variables and their vales in record producer script (using producer.variable_name) and then trigger an event passing this JSON as parameter.
On the notification select this event and then use the email script to parse this JSON and add in the body or to populate subject.
But please note that in this case if the incident is not creates for any reason in the backend (which is rare) even then the email will be triggered.

If not these 2 then you need to find where the record producer variables and their values submitted are stored

-Tanaji
Please mark response correct/helpful if applicable