Can i update values of the 2 tables (Change_Request and asmt_assessment_instance) in one BG Script?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-06-2024 07:17 PM
Can i update values of the 2 tables (Change_Request and asmt_assessment_instance) in one BG Script?
1. Change request survey stored in the asmt_assessment_instance table.
2. So i wanted fill the value of the asmt_assessment_instance table and then close the change task.
3. Is that possible in one go using the Background script. Please Assist.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-06-2024 07:43 PM
yes if you are able to get relationship between the records for 2 tables
what did you start with and where are you stuck?
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-06-2024 07:45 PM
Just wanted to know what kind of relationship is that. Could you give an example. I am gliding inside table and setting the values to update.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-06-2024 09:17 PM
Hi
You can follow below steps.
- Glide record (gr1) on asmt_assessment_instance table with filter "trigger_table=change_task^state=ready^metric_type=sys_id of your survey".
- Run while loop to get all the pending survey which not yet completed.
- Now again do glide record (gr2) on asmt_assessment_instance_question table to get the associated question and user filter like "instance=sys_id of assessment (gr1.sys_id)" which you will get from first loop.
- Now in 2nd while loop set the answer for the question and update.
- In 1st while loop close the close the change task while updating the state.
-------------------------------------------------------------------------
If you found my response helpful, please consider selecting "Accept as Solution" and marking it as "Helpful." This not only supports me but also benefits the community.
Regards
Runjay Patel - ServiceNow Solution Architect
YouTube: https://www.youtube.com/@RunjayP
LinkedIn: https://www.linkedin.com/in/runjay
-------------------------------------------------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-12-2024 12:34 PM
Thanks Runjay,
But i am notable to glide two tables and mainly i could not able to do bulk update. (gr.addEncodedQuery("query")