- My View
Steven Bell, Community MVP, will be presenting on how to create an Outbound REST Message to a REST Web Service, and then how to query the service, and parse the JSON returned results via a Fix Script.
Join us on October 13, 2016 at 10am PT (est 30mins)
Steven Bell is an Architect Manager and ServiceNow Trainer for Accenture Cloud-First. He has over 30 years of Developer experience. His areas of expertise include Application Development, Development Process, Orchestration, Discovery, Asset Management, Software Quality Assurance. Steven's prior experience includes web services development in C#/.Net. He earned a BS in Computer Science from Texas Tech University - Lubbock.
And Please Let our Expert Know how they've helped! Comment Below!
Like, Share, Mark Helpful.
You used a fix script as an example to fire the REST Message. What are the other ways on a more permanent basis if it was to run regulary?
Great job and good information!
My question is about pushing the parsed results into an import_table row. Do we need associate the import set row to a import set by creating a sys_import_set and assign that sys_id to all rows?
With the implementation ECMA5 in Helsinki you get JSON.parse. This is not available prior to Helsinki.
This was a great video!! I had already done the lab but needed clarity on the JSON.parse(responseBody) which is different than what I had previously used and the var success = parsed.success = 'true'; which I didn't understand until Steve explained.
As far as future video's go it would be nice to see one using REST with authentication. Specifically OAuth. The video that is on docs.servicenow.com shows how to use the OAuth in Postman but does not show how to apply it. What you would need to send the third party to request data from your instance. Also the reverse, what you would need to request data from a third party for your instance, when the third party is expecting OAuth. Scripting examples with sn_ws.RESTMessageV2 for Helsinki.
Nice job on video. Steve I like the way you explain the code so clearly. A nice add for weaker scripters is to introduce the Preview Script Usage UI Action from the REST message form to show how ServiceNow actually provides a large chunk of the code needed to call the REST Message successfully from any script. Thanks for doing!
Thanks Glenn. Yeah thought about that after the video was over, and I was going over my notes. :-/ Figures.
Thanks Glenn. Yeah thought about that after the video was over, and I was going over my notes. Figures.
sr. implementation specialist
tech arch manager
<mailto:firstname.lastname@example.org>direct: +1 469-719-5289
Firstly your video is great. and thanks for sharing.
I get this error when i run the script: java.lang.IllegalArgumentException: host parameter is null
Take a look at the following article (I wrote this up awhile back before giving the video presentation). See if it fills in any missing steps, and perhaps gets rid of the error in the process.
Hi Steve, near the very end of the presentation, someone asks a question about how you would set the retrieved values into a table. Can you share briefly what the best practice would be? This would fundamentally "complete the integration" of just retrieving the message, and parsing and setting the variables into something we would actually be able to store in a table somewhere. tantony mentions to use an import set or transform map - can you elaborate on what the best practice is? I'm imagining something like using a scheduled transform running the script you create to insert and transform the values. Appreciate your video and help.
If you are going to automate using a scheduled script execution job, then the best practice will be using an import set. You can use an existing working import table and transform map or create a new one.Load the parsed data to an import table. Servicenow will automatically do the transformation and update the target table based on the transform map. The coalescing fields defined in transform map will help Servicenow to decide whether to do an update or insert, thus avoid duplicate records being inserted which can happen in a direct load to target table .
http://wiki.servicenow.com/index.php?title=Using_the_Coalesce_Field#gsc.tab=0 "In an import, coalescing on a field (or set of fields) means the field will be used as a unique key. If a match is found using the coalesce field, the existing record will be updated with the information being imported. If a match is not found, then a new record will be inserted into the database."
The davidself3's post will help you Wanting to Import data using external REST service on a schedule using Import Set / Transform Map