How to use script on Virtual Agent to filter table "sc_cat_item" by "reference type" field -> Category?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-23-2022 07:17 PM
Dear all,
I tried to use the filter like "category contains Navigation" in the sc_cat_item and no records were found:
Then I used "gr.addEncodedQuery('categoryLIKENavigation')" in Scripts of the "Reference Choice" node in Virtual Agent:
But it can show me 4 records and they really belong to the category of Navigation:
The current problem is that the results displayed by the query in the table and the Virtual Agent query are inconsistent. I know the reason is that Category is a field of type "reference".
So I want to know how to write Scripts so that the results on the Virtual Agent are consistent with the query results of the sc_cat_item table.
thank you very much.
- Labels:
-
Virtual Agent
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-24-2022 02:32 AM
Hi,
in your background script you are not adding the query for Navigation title
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
08-24-2022 06:49 PM
