Update a RITM variable field via an approval comment in an email

Bidduam
Tera Guru

So I have a catalog item that has a flow that once the Request and RITM is logged an approval is sent the a manager.

 

The manager has a link in the approval email that when they approve a email reply template is generated with an obvious spot for them to add a reply message.

What I want to do is have the email read upon reply, extract a particular part of the email out and update a variable that is on the RITM that is associated with the approval that was replied to.

So for example:

REQ00110011

    >> RITM110001

         >> APPROVAL - Manager approval email

            >> Manager responds via the approval email

>> inbound Action to extract the response from the body of the email (not the entire body preferably) and updates a variable called "u_manager_response" on the RITM (RITM110001)

 

Anyone know how this is possible to achieve?

1 ACCEPTED SOLUTION

Bidduam
Tera Guru

Thank you @Mark Manders & @Ankur Bawiskar thank you both for you help.

Ultimately I have created an Inbound email flow and added a custom action of mine to update the variable value that I wanted to add the email body text extract to and wrote a script to extract the text.

I've added a | to the start of the text area I want and the same | to the end and the following script extracts what is between the |   |

var input = fd_data.trigger.body_text;
var parts = input.split("|");
var result = parts.length > 1 ? parts[1].trim() : "";
return result;

 

I totally understand that users sometimes don't follow basic instructions and this ultimately may not be the final solution, but we will test it and see how it goes.

Thanks again to both of you for trying to help - it certainly put me on the right path.

View solution in original post

5 REPLIES 5

Bidduam
Tera Guru

Thank you @Mark Manders & @Ankur Bawiskar thank you both for you help.

Ultimately I have created an Inbound email flow and added a custom action of mine to update the variable value that I wanted to add the email body text extract to and wrote a script to extract the text.

I've added a | to the start of the text area I want and the same | to the end and the following script extracts what is between the |   |

var input = fd_data.trigger.body_text;
var parts = input.split("|");
var result = parts.length > 1 ? parts[1].trim() : "";
return result;

 

I totally understand that users sometimes don't follow basic instructions and this ultimately may not be the final solution, but we will test it and see how it goes.

Thanks again to both of you for trying to help - it certainly put me on the right path.