- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-17-2017 11:12 PM
I have a third party endpoint, when i save it am getting only 'Default Get' method(no other methods are generated), when i test, am able to get all user details in 'Response' field (json format) , now i want to add these records to my sys_user table, how to do that?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-18-2017 01:08 AM
Hi Swathi,
you need to parse the response using JSONParser() and iterate over the key value pairs
Can you share the response so that the script can be designed?
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
‎01-17-2017 11:49 PM
No worries about "Default Get" method, you will see only those methods which are available in that third party webservice end point. The OOB functionality says, you first configure a REST Message using that third party end point and then run that get method. From therefore, copy the code using ServiceNow script link and write a server side script e.g. Business rule, Scheduled Job script etc and call that REST message from there.
Let me know if it helps!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-18-2017 12:08 AM
Lalit thanks a lot for your help, now am running that script through scheduled job, how to parse the obtained result and how to store it into sys_user table?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-18-2017 01:08 AM
Hi Swathi,
you need to parse the response using JSONParser() and iterate over the key value pairs
Can you share the response so that the script can be designed?
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
‎01-18-2017 01:50 AM
Hi Ankur,
Below is the response i got...
{\"UserID\":\"10001460\",\"Name\":\"B. Swathi\",\"FIrst Name\":\"B.\",\"Last Name\":\"Swathi\",\"Email\":\"\",\"Company\":\"ABC Corp Limited\",\"Company Code\":\"ABC0002\",\"Building\":\"Nagar\",\"City\":\"Cp Dist\",\"Country\":\"INDIA\",\"Department\":\"Support\",\"Vertival\":\"Admin\",\"Sub Vertical\":\"Admin\",\"Gender\":\"Male\",\"Business Phone\":\"\",\"Location\":\"India\",\"Manager\":\"Ashok\",\"State\":\"Kar\",\"Street\":\"kur\",\"Time Zone\":\"\",\"VIP\":\"\",\"Pincode\":\"500\"}