- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-15-2023 08:46 AM
Hi,
I have created a catalog with nested categories. Inside categories there are different catalog items.
An example: Pen & Pencil > Pen > Blue pen
Blue pen is my catalog item and inside the form there are these fields:
Category: Pen & Pencil
Sub category: Pen
Item: Blue Pen
How can i autoppulate these fields by mean of a catalog client applied to a set of variables?
The idea is that it is autopopulate for any catalog item that i select.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-15-2023 11:15 AM - edited 05-15-2023 11:17 AM
Hi @Matteo M ,
I recreated your example and used an onLoad Client script and a script Include to achieve the above scenario. Please find the below code Snippets:-
Client Script:-
Code Snippet:-
Code Snippet:-
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-16-2023 05:44 AM
Hi @Matteo M ,
Create your Script Include as per my screenshot with the same name and function.
If you are using a Variable set then create a client script in the variable set. There is no difference it should work.
Yes, the above change you made is correct.
Thanks & Regards,
Suma.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-16-2023 01:57 AM
based on particular variable you want to auto-populate some other variables?
which variable is that?
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-16-2023 03:55 AM
Hi @Ankur Bawiskar
From the service portal i have a catalog with nested categories, and inside categories i have different catalog items.
Now the form of each catalog item is set by a variable sets. These variables set requires to fill in Category, sub category, sub sub category, and catalog item name. So, example:
From catalog i select the category "item", then "pen and pencil", then "pen", then "blue pen".
The form should be:
Castegory: Item
Sub category: Pen and pencil
Sub sub category: Pen
Catalog item: Blue pen
It should work for any kind of catalog item and category that i will open. So it should be one code working for every form.
Regard,
Matteo