Inbound Email Action is setting the 'Requested for' field as Guest when though the user exists

sreenivaskumar
Giga Contributor

Hi,

I had created an Inbound Email Action to create a request every time we receive an email with a certain keyword from one particular email address. I had later created a user account with this email address. Now this inbound email action is working but the 'requested for' field comes up as guest instead of the name of the account i created with that email address. But it correctly shows the account name in the Email logs under User ID column

 

This is the code i am using to get the requested for field info

cart.requested_for = myUserObject.getRecord().getValue('sys_id');

 

I am not sure if this is wrong

1 ACCEPTED SOLUTION

Jim Coyne
Kilo Patron

Try:

cart.requested_for = sys_email.user_id;

"sys_email" is a GlideRecord of the email record the Inbound Action is responding to.

View solution in original post

7 REPLIES 7

This bit of code was helpful for my use case. I used different functions to find my requested_for and Opened_by but it worked for me in my use case:

var req = new GlideRecord ('sc_request'); 
req.get(rc.sys_id); 
req.requested_for = myUserObject.getRecord().getValue('sys_id');

req.opened_by = myUserObject.getRecord().getValue('sys_id');
req.update();

Jim Coyne
Kilo Patron

Try:

cart.requested_for = sys_email.user_id;

"sys_email" is a GlideRecord of the email record the Inbound Action is responding to.

Thanks a lot Jim. It worked perfectly