How to get catalog variables under related list in ServiceNow ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-10-2022 07:13 AM
Any idea on how to get the variables under the RL ?
I submit catalog form for say product 'Apple v1.2' with catalog variables as build number=132 and requested location as Onsite. (There is a field to choose 'product' on the catalog)
Now, when I check the product list view and open the product page for Apple v1.2, I must see the related list with record as build number=132 and Requested location as Onsite.
If I submitted the catalog for this product 3 times, I must see 3 records under the related list, each record under the list having columns as build, location
Stuck at the script level in relationship script to map the product name with the variable field holding the product and then get the phase and build variables under the RL
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-11-2022 09:11 AM
I dont see variables in the columns list for the related list on form. I see all fields from RITM but n catalog variables.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-11-2022 08:59 AM
If I understand correctly what you want is a pivot of data: transform variables that are rows in a table into columns in a table. If that is not correct, just ignore what's below. If that is correct, I see 3 (possible solutions):
- Create a table into which you pivot data - this also allows easily showing "backend" data as human readable (e.g. a reference is stored just as a sys_id in the table that holds variable values)
- Create a database view that pivots the data, joining each requested item to all the variables and the variables to the referenced and choice tables - use this view in the scripted relationship.
- Not really a proper solution for the requirement, but: a form formatter where you practically build a the table ad-hoc and show the data as you see fit - but this will not be a related list. You could also try to embed the report you saw in the video while at it.
I would also look into using remote tables: fetch the data and pivot it in script - but this might have licensing implications; would clear up with SN rep. before investing effort into it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-11-2022 09:12 AM
Janos,
Thanks but my ask is something else -
I submit catalog form for say product 'Apple v1.2' with catalog variables as build number=132 and requested location as Onsite. (There is a field to choose 'product' on the catalog)
Now, when I check the product list view and open the product page for Apple v1.2, I must see the related list with record as build number=132 and Requested location as Onsite.
If I submitted the catalog for this product 3 times, I must see 3 records under the related list, each record under the list having columns as build, location