- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-18-2020 10:52 AM
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
Solved! Go to Solution.
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-18-2020 09:38 PM
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.
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

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-18-2020 10:14 PM
Hi
Try below code
var correlation_id = getResponse.result.number;
Thanks
Himanshu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-19-2020 01:16 AM
Himanshu,
thank you for your email, however this doesn't work
Kind regards
Steve

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-19-2020 04:22 AM
Have you parsed response body?