How to get variables in email body in inbound email flow?

S_ren H_fer
Kilo Guru

I want to get access to my own variables in the email body in a script part in the flow designer. The variable is placed as described in servicenow docs with Name:Value in the email body.

The query with fd_data._1__look_up_record.record.body.name returns no value.
 
Any ideas?
1 ACCEPTED SOLUTION

Mark Roethof
Tera Patron
Tera Patron

Hi there,

A few days I opened a similar topic... unfortunately no luck so far. Looks like custom parsing needs to be set up to achieve this. A lot easier with old school Inbound Actions 😞

https://community.servicenow.com/community?id=community_question&sys_id=054c7977dbf1d4104aa5d9d96896...

Also haven't seen an improvement for this with Paris. So Inbound Flow does not feel ready to go yet.

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

View solution in original post

4 REPLIES 4

asifnoor
Kilo Patron

Hi

I don't think that feature is still available in inbound email flow yet. you can drag and drop the short description or body as pills but variables inside the body are not accessible. 

 

Mark Roethof
Tera Patron
Tera Patron

Hi there,

A few days I opened a similar topic... unfortunately no luck so far. Looks like custom parsing needs to be set up to achieve this. A lot easier with old school Inbound Actions 😞

https://community.servicenow.com/community?id=community_question&sys_id=054c7977dbf1d4104aa5d9d96896...

Also haven't seen an improvement for this with Paris. So Inbound Flow does not feel ready to go yet.

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

Megha Padale
Giga Guru

Hi,

Check this link, it might help you

https://community.servicenow.com/community?id=community_question&sys_id=95b3d07edbed481023f4a345ca96...

If my answer helped you in any way, mark answer as helpful and correct.

Thanks and regards,

Megha.

aliqaiser
Tera Contributor

Thanks for every one for replying . I have finally found the solution for this issue . The answer lies in the following code . Not a complete perfect solution but it will solve much of the issue around extracting the string from email body.

 

q = fd_data.trigger.body_text.match(/Impact : (.+)/m);  // i am capturing the Impact : 1
 
System
Work notes•
02-11-2021 23:26:48
Incident created from mail box ****@gmail.com with details :
Issue : Can't open the VDI session on my laptop
Requested by : *****
Impact : 1
Urgency : 2
 
Note : For reference field population , you have to do a gliderecord query to respective ITSM table ( Inc , chng etc) 
 
Here is the sample code in case you are putting assigned to ( this one comes in script portion of flow designer field)
 
var user = "" ;
var user_1 = "";
user_1 = fd_data.trigger.body_text.match(/Requested by : (.+)/m);
user = user_1[1];

// Glide query to sys_user

var gr = new GlideRecord('sys_user');
gr.addQuery('name',user)
gr.query();
while(gr.next()){
user =gr.sys_id;
}
return user;
** Please mark as correct if you find it helpful