Flow designer script to remove text from subject line leaving Correlation ID

SW7
Giga Guru

Hi Community,

I have a question regarding the use of scripts in Flow Designer. I have a script that creates and updates an incoming email into a incident ticket. The last part of the flow I have added an update action for the incident with correlation ID so that when a supplier sends their correlation id in the email subject line this populates the correlation id field in servicenow ticket and I need to write a one line script using the f(x) box.

So far I am able to pull the entire subject line into the correlation box, but I only need the number, 

Appreciated your assistance

Many thanks

Steve 

 

1 ACCEPTED SOLUTION

Hi

Below, I just created a test-flow, which adds the String "OK" to the field "Info" and writes it back to the field "Info2". Same way you can do with the "substring" to cut out the right-most characters from my answer above.

find_real_file.png

Note, that my example is NOT on an "inbound mail action", but let me know if you can sort out the problem.

Let me know if that answers your question and mark my answer as correct and helpful.

BR

Dirk

 

 

 

 

View solution in original post

12 REPLIES 12

Himanshu Dubey
Giga Guru

Hi

Try below code

var correlation_id = getResponse.result.number;

Thanks

Himanshu

Himanshu,

thank you for your email, however this doesn't work

Kind regards

Steve

Have you parsed response body?