- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-03-2025 11:17 PM
Hello All,
I need a quick help in my inbound action.
I have a scenario in which i have to add CC user to caller field when email is coming from certain user. Can anyone help me what is wrong in my code. Usually, it will be single person in CC, but i tried with array too still there is no luck
if (senderEmail == 'test@gmail.com' ) {
if (email.cc) { // Ensure CC exists
var ccUserEmail = email.cc.toString().trim(); // Convert to string and remove spaces
var ccUserGR = new GlideRecord('sys_user');
ccUserGR.addQuery('email', ccUserEmail);
ccUserGR.query();
if (ccUserGR.next()) { // If user found, assign to Caller
current.caller_id = ccUserGR.sys_id;
}
}
if (senderEmail == 'test@gmail.com' ) {
if (email.cc && email.cc.length > 0) {
var ccEmails = email.cc.toString().split(','); // Convert to list if needed
var ccUserEmail = ccEmails[0].trim(); // Get first email from CC
var ccUserGR = new GlideRecord('sys_user');
ccUserGR.addQuery('email', ccUserEmail);
ccUserGR.query();
if (ccUserGR.next()) {
current.caller_id = ccUserGR.sys_id;
}
}
}
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-04-2025 12:36 AM
Hi @SM123 ,
It seems 'email.cc' is not a valid property, please try using 'email.copied' instead and see if that works.
'email.copied' contains a comma-separated list of email addresses in the Cc.
If this address your question, please don't forget to mark this response correct by clicking on Accept as Solution and/or Kudos.
You may mark this helpful as well if it helps you.
Thanks,
Animesh Das
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-04-2025 12:36 AM
Hi @SM123 ,
It seems 'email.cc' is not a valid property, please try using 'email.copied' instead and see if that works.
'email.copied' contains a comma-separated list of email addresses in the Cc.
If this address your question, please don't forget to mark this response correct by clicking on Accept as Solution and/or Kudos.
You may mark this helpful as well if it helps you.
Thanks,
Animesh Das
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-04-2025 03:53 AM
Hi @Animesh Das2 ,
I tried but still not working.
if (email.copied && email.copied.length > 0) {
var ccEmails = email.copied.toString().split(','); // Convert to list if needed
var ccUserEmail = ccEmails[0].trim(); // Get first email from CC
var ccUserGR = new GlideRecord('sys_user');
ccUserGR.addQuery('email', ccUserEmail);
ccUserGR.query();
if (ccUserGR.next()) {
current.caller_id = ccUserGR.sys_id;
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-04-2025 05:27 AM - edited ‎02-04-2025 05:29 AM
@SM123 ,
Can you verify first if you are getting the value of email.copied at all, preferably for a single email address in CC? If yes then, if it is a new record to create then try with current.insert() at the end or if it is an update to the record then try with current.update() if that helps.
If you still face any issue, share the SS of the 'Inbound email action' along with 'When to run' field values for more understanding.
If this address your question, please don't forget to mark this response correct by clicking on Accept as Solution and/or Kudos.
You may mark this helpful as well if it helps you.
Thanks,
Animesh Das
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-04-2025 05:35 AM
Hi @SM123
Try:
If my response proves useful, please indicate its helpfulness by selecting "Accept as Solution" and " Helpful."
Thank You!