Indexing Email Body for Inbound Action

bradfournier
Kilo Expert

I'm working on an inbound action where ideally it is searching the body of the email for a certain string as part of the condition. I've created the conditions as seen below, but for some reason the IA is getting skipped over. I'm wondering if maybe it's not possible to do the way I'm trying. Has anyone had any luck with this?

Conditions

(email.recipients.toLowerCase().indexOf("techadmin@xyz.com") > -1) &&

(email.body.toLowerCase().indexOf("newrepcomm") > -1)

The inbound emails will all have the following line in the body, this is what I'm looking for in the condition.

"There is a new NewRepComm Set Up case (123456789) for user..."

1 ACCEPTED SOLUTION

In your conditions field try this



(email.recipients.toLowerCase().indexOf("techadmin@xyz.com") > -1) &&   (email.body_text.toLowerCase().indexOf("newrepcomm") > -1)


View solution in original post

7 REPLIES 7

Abhinay Erra
Giga Sage

Your condition looks fine to me. There may be some other reasons why iot is skipped. What exactly the inbound action should be doing here? Can you post the code of your IA


Here is the IA:


gs.log(email.subject + " Start Create NewRepComm TECHA - NEW Inbound Script");




current.short_description = email.subject;


current.work_notes = "New email received from: " + email.origemail + "\n\n" + email.body_text;


current.description = "New email received from: " + email.origemail + "\n\n" + email.body_text;




gs.log(email.recipients + " Email Address");


var sid = gs.createUser(email.from);


var sepm = sys_email.user;




current.u_requested_for = sepm;


current.opened_by = sepm;


current.u_request_type = 'User Management';


current.u_sub_type = 'Permissions';




current.state = -5;


current.assignment_group.setDisplayValue('Technology Administration');




current.contact_type = "email";


current.insert();




gs.log(current.number + " TECHA Number");




gs.log(email.subject + " End Create Tech Admin Request - NEW Inbound Script");




event.state="stop_processing";


current.state = -5;


current.assignment_group.setDisplayValue('Technology Administration');




current.contact_type = "email";


current.insert();




gs.log(current.number + " TECHA Number");




gs.log(email.subject + " End Create Tech Admin Request - NEW Inbound Script");




event.state="stop_processing";




I believe that the IA is being skipped entirely, as I'm not getting any of the gs.logs I entered in the Script Statement Log. It's like it's not even starting.


Abhinay Erra
Giga Sage

Can you check the order of the IA. Make sure there are no other IA on this table with lesser order and can you post a screenshot of IA   which captures the conditions on IA


I have confirmed that it is the lowest order IA that runs on this table. Is this the screenshot you're looking for?


IA.png