- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-22-2019 02:16 AM
Hello, The requirement is:
1. Create a UI Page: Provide a textbox to enter the incident number and a button "Search" to click
2. Upon Button click - I would need to query Incident table from " Instance2 " and search for that incident. Extract certain details of that Incident and display in the same UI page.
3. Provide an option to create a New Incident in "Instance1" using these fetched incident details.
I need not have to UI page, if there is any other method of displaying data. What is the best approach i should take?
I am new to REST API's, could anyone suggested code to "GET" details?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-22-2019 02:30 AM
Hi Manikandan,
so use following approach:
1) create UI page with text box as Incident Number
2) have a button; on click of button call a function and send the value of incident number to the client script section of UI page
3) from that Client script; call a script include function using GlideAjax and send the incident number
4) consume the instance 2 table api for incident with query as number=INC00001
5) parse the response and send it back to client script
6) display that inside a paragraph tag
6) have a new button and onclick of that show a custom form where user will fill the details
7) when used hits submit/update on that form then call the table API for creating a record in instance 2
sample endpoint for GET: I have fetched values for INC0010153 and fetched column values for short_description, assignment_group, assigned_to
https://instanceName.service-now.com/api/now/table/incident?sysparm_query=number%3DINC0010153&sysparm_display_value=true&sysparm_exclude_reference_link=true&sysparm_fields=short_description%2Cassignment_group%2Cassigned_to
Mark Correct if this solves your issue and also mark 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
‎07-22-2019 02:30 AM
Hi Manikandan,
so use following approach:
1) create UI page with text box as Incident Number
2) have a button; on click of button call a function and send the value of incident number to the client script section of UI page
3) from that Client script; call a script include function using GlideAjax and send the incident number
4) consume the instance 2 table api for incident with query as number=INC00001
5) parse the response and send it back to client script
6) display that inside a paragraph tag
6) have a new button and onclick of that show a custom form where user will fill the details
7) when used hits submit/update on that form then call the table API for creating a record in instance 2
sample endpoint for GET: I have fetched values for INC0010153 and fetched column values for short_description, assignment_group, assigned_to
https://instanceName.service-now.com/api/now/table/incident?sysparm_query=number%3DINC0010153&sysparm_display_value=true&sysparm_exclude_reference_link=true&sysparm_fields=short_description%2Cassignment_group%2Cassigned_to
Mark Correct if this solves your issue and also mark 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
‎08-20-2019 09:43 PM
Thanks Ankur.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-20-2019 11:14 PM
Thanks for marking answer as correct.
Can you also mark it as helpful.
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader