- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-13-2023 08:04 AM
I'd like to parse an inbound email for a user employee number and use it to retrieve multiple other attributes in the record to populate a form.
My sys_user table has an attribute called "u_employee_number"
In the email body I'm user this variable pair
requestor:123456
In my inbound action script I'm trying
var userid = new GlideRecord('sys_user');
userid.addQuery('u_employee_number',requestor);
userid.query();
if(userid.next()){
var id = userid.sys_id();
}
Then I want use the sys_id in my catalog item:
if(requestor!=undefined)
hddcart.setVariable(item,"requestor_name",id);
This isn't working.
Can you help?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-13-2023 08:43 AM - edited 11-13-2023 08:52 AM
Hi @Joe Taylor
You can fetch multiple attributes using the same object:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-13-2023 08:21 AM
Hello @Joe Taylor ,
Directly the variable will not work in inbound action.
Please first retrive the email body by using the below syntax
var emailBody= email.body_text;
then try to get the employee number from the body
var requester= emailBody[1];
then gliderecord to sys_user table. Please debug it according.
Thank you,
Omkar