- Post History
- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
on 01-25-2021 12:22 AM
I am new to ServiceNOW community and here is my first article related to service catalog. Did not find an exact article on this topic so thought to write one up. Please share your feedback. Thanks!
Recently had a requirement on service catalog where user wanted to submit a single order to perform some operation in bulk on the specified assets.
User wanted to submit only one order but with multiple asset where some information is going to be unique across assets - hence we then have to deal with order level information that is going to common across assets under that order and asset level information that is going to be unique across all assets under that order.
The obvious choice for this was to introduce a 'multi-row' variable set that would capture this unique asset information in tabular format which could further be utilized for processing.
However, the solution i thought of needs a table to be populated in backend separately so that the records from the table can be utilized for further processing, without having to rely on question_answer/sc_item_option/sc_item_option_mtom tables and complex code to identify the questions and answers.
Hence, thought of writing a catalog client script to achieve this solution.
Below are the steps to achieve the solution -
- Create a multirow variable set with 2 fields - field x and field y.
- Add this variable set to any existing catalogue item in your PDI.
- Create a custom table with a couple of more columns (for further processing - optional if you dont need to) apart from field x and field y that will be captured from the multi-row variable set. Ensure that you have correctly selected the data types for field x and field y and the data types for these two fields matches with the data type of field x and field y of variable set.
- Create a catalogue client script
- Select 'Applies to' = 'A variable set'
- Select 'Type' = 'On Submit'
- Select 'Variable Set' = <name of the variable set created in step 1>
- Write a piece of code in 'script' section as follows
5. Save the catalogue client script.
6. Testing - Navigate to the service catalogue to which you added this multi-row variable set in step 2. Order it and start filling the multi-row variable set. On each click of 'Add' button on the popup, a table record will get created in the target table.
- 967 Views
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
GlideRecord in the client script is not recommended, Instead we can use this glide record in the Script include and create the record
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
What are you planning for delete.