- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-05-2023 06:17 AM
Hi all,
I'm trying to set field values from an inbound email but cannot seem to get it to work.
From the screen shot below I'm trying to populate the requested for field based on the manager label from the email body
As you can see the parsing of info from the email to the requested item is working but still cannot get the manager set as the request for field
Here's the inbound action:
FYI the requested for at task level for us IS a custom field.
Any help or guidance would be appreciated.
Thanks
Alex
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-05-2023 06:35 AM
As requested for field is the reference field so it requires the sys_id of the user
My assumption is you are providing the exact name to the "requested_for" field
you need to first make the GlideRecord to the user table and map the manager field as follows:
var gr = new GlideRecord('sys_user');
gr.addQuery("user_name", email.body.manager); // please change the field name according to your requirements
gr.query();
var requestedForSysID = "";
if(gr.next()){
requestedForSysID = gr.sys_id; // sys_id of requested for
}
And map the sys_id with the requested for field
Please accept the solution + Accept it, if it has answered your query!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-05-2023 06:27 AM
Just check value of email.body.manager in logs inside email action ,there might be changes in name add appropriate name of manager
Let me know for more help
Thanks,
Manjusha Bangale
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-05-2023 06:35 AM
As requested for field is the reference field so it requires the sys_id of the user
My assumption is you are providing the exact name to the "requested_for" field
you need to first make the GlideRecord to the user table and map the manager field as follows:
var gr = new GlideRecord('sys_user');
gr.addQuery("user_name", email.body.manager); // please change the field name according to your requirements
gr.query();
var requestedForSysID = "";
if(gr.next()){
requestedForSysID = gr.sys_id; // sys_id of requested for
}
And map the sys_id with the requested for field
Please accept the solution + Accept it, if it has answered your query!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-05-2023 10:56 AM
If my answer solved your issue, please mark my answer as ✅ Correct & 👍Helpful based on the Impact.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-06-2023 01:50 AM
@Alex Saager1 - You can accept the solution also, it would be helpful in the future if someone has the same query!