Inbound action to find phrase in body of email and update field in record
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā06-23-2022 04:48 PM
Hi,
I have the requirement to match the keywords 'General Manager' in an inbound email's body (coming as a reply from an approval email - the sysapproval table) which updates the 'u_approval_waiting' field in a record to 'general_manager' - in the u_hr table.
What would the inbound action script be for this?
Or is there another way to get the comments from the record (published to the sysapproval table, not u_hr - I figured this out by trying to use flow designer) to update the 'u_approval_waiting' field?
Thanks in advance!
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā06-23-2022 05:58 PM
Hi Bianca, Here you go -
if(email.body.toLowerCase().indexOf("general manager") != -1)
{
//update field
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā06-23-2022 06:49 PM
Thanks Pradeep.
I know that the target table needs to be on Approval and have it processing (currently nothing) now. When I had it on the u_hr table it didn't work.
What would the update field part be to update the field on the u_hr table?
I tried with the following and it didn't work:
current.u_waiting_approval = general_manager;
current.update();
I got the response "did not create or update sysapproval_approver using current"

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā06-23-2022 09:21 PM
Hi Bianca,
I believe you need to dot-walk to that email "field" (the name in name:value pair). Try:
current.u_waiting_approval = email.body.general_manager;