Removing the mapped option in 2 List collector variables based on selection
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-20-2023 08:36 PM
Hi All,
I have a requirement as mentioned below.
In catalog item I have 2 list collector variables.
1- 1st variables reflect the task number and we can select multiple tasks ex : INC,PRB,CHG,TASK since its a list collector variable
2- 2nd list collector variables reflects the corresponding selected tasks response and resolution SLA details.
Ex in list collector 1 i selected the tasks as INC00001, TASK00002, PRB 123456, CHG 23451.
Now corresponding to above selected tasks in the list collector 2 i have the option to choose response/resolution SLA's for INC00001 (RESPSLA1, RESOSLA2), TASK00002(RESPSLA3, RESOSLA4), PRB 123456(RESPSLA5, RESOSLA6), CHG 23451(RESPSLA7, RESOSLA8)
Hence in the list collector 2 i have 8 values with 2 SLA values each mapped to selected Tasks.
Now if I remove INC00001 from list collector 1 then RESPSLA1, RESOSLA2 should get removed from list collector 2.
if I remove TASK00002 from list collector 1 then RESPSLA3, RESOSLA4 should get removed from list collector 2.
Let me know as how this requirement can be achieved.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-20-2023 08:40 PM
@Ankur Bawiskar - Can you throw some knowledge of yours on this ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-20-2023 08:53 PM
you need to use onChange client script and do this using GlideAjax
1) get the task sysIds
2) simply query task sla table for the new value from 1st list collector using script include function
3) then set the list collector with the updated values rather than removing value
what did you start with and where are you stuck? it should be an easy one
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
09-20-2023 09:37 PM
Thanks @Ankur Bawiskar for your prompt response.
Setting up the values in list collector 1 and list collector 2 is not an issue currently for me. I am setting the values in both the fields using "Reference Qual" functionality of the catalog variables and its working fine as well for me.
Now how to remove the mapping values in list coll 2 for value selected in list coll 1 is what the challenge I am facing.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-20-2023 09:45 PM
you can handle it via onChange + GlideAjax as already mentioned in my earlier comment.
Since you already have reference qualifier on 2nd variable that will be in sync with the script include returned sysIds
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