- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-12-2017 09:41 AM
I'm creating a REST message and triggering it to execute through a workflow. This is my first attempt at a REST message. I need to pass the RITM number back to the third party when a request is approved. The endpoint my the third party is as follows -- https://hosted-site/test/rest/integration/workorder/${u_work_order_number}. The third party is initially sending a POST to create a service request. They are sending us the variable called u_work_order_number. Will the rest message endpoint dynamically pick up that number and throw it in the endpoint? Or do I need to set that variable, along with my ${number} variable sent in the payload, somewhere in the REST message before I use it?
REST MESSAGE
Call in WorkFlow
Solved! Go to Solution.
- Labels:
-
Integrations
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-12-2017 10:16 AM
Hi Jake,
Yes that's correct. Anything which is dynamic you will require to create variable substitutions and use those in script.
once you create variable substitution you can click preview script usage and it will show you syntax.
Variable substitution in outbound REST messages
Outbound REST Web Service - ServiceNow Wiki
Mark Correct if this solves your issue and also hit Like and Helpful if you find my response worthy based on the impact.
Thanks
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-12-2017 10:16 AM
Hi Jake,
Yes that's correct. Anything which is dynamic you will require to create variable substitutions and use those in script.
once you create variable substitution you can click preview script usage and it will show you syntax.
Variable substitution in outbound REST messages
Outbound REST Web Service - ServiceNow Wiki
Mark Correct if this solves your issue and also hit Like and Helpful if you find my response worthy based on the impact.
Thanks
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-12-2017 10:23 AM
You can put this at the line 10 before r.execute
r.setStringParameterNoEscape('number',current.number);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-13-2017 05:53 AM
Hi Jake,
Any update on this?
Can you mark answer as correct, helpful and hit like if you were able to achieve the requirement. This helps in removing this question from unanswered list and helps users to learn from your thread. Thanks in advance.
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-13-2017 06:19 AM
I will know more in about a hour or 2 when we test the functionality....I'm fairly confident it will work based on the input you provided me. Marking correct.