- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-05-2018 12:58 PM
Here's a fun one.
Scenario: I have a Catalog Item made up of a few variable sets and some single variables. One variable set is a common one that contains the Requestor, Short Description, Description, Location, and some others.
Challenge: How to get just the two fields (Short Description and Description), which are a part of a commonly used update set, to be displayed below the single variables.
Assumption: I assume that a client script could be derived to change the order of those two fields onLoad, but the challenge is how to achieve that to work with the portal. Any help on the script and making it work on the Service Portal would be greatly appreciated. The reason that i'm not simply re-creating those two fields is because there are many areas in the tool that Short description and description are important to use OOB.
ORIGINAL
DESIRED
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-05-2018 02:03 PM
Would be a pain in the *** to mix those I think with a client script. That part is using ServiceNow custom elements like <sp-cat-item> and <sp-variable-layout> etc.
Without going to deep and looked. I would say best option would be to customize the Server script on the widget and perhaps be able to manipulate the order field from there.. but it's a lot of work for 2 variables in one item. I would rather just create them manually instead.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-05-2018 01:05 PM
Hi Jeremy,
I don't think it would be worth the effort to try and do this with DOM manipulation. I wouldn't recommend it either of the standard upgrade issues etc. What is stopping you from splitting them out from 1 variable set to 2 variable sets? then you can give the set with description a higher order so it will be placed further down the list.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-05-2018 01:15 PM
Göran, thanks for the reply. I can't split these up, because I have way too many other catalog items that are using the set as is. It would be more work to split up. If there is no simpler solution, I may just have to re-create those variables for this one item...and adjust the portal widgets to accommodate. The good news is that I have a dedicated portal for this particular item, so that wouldn't be impossible to overcome. I was just hoping for some Client Side approach that made more sense....
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-05-2018 02:03 PM
Would be a pain in the *** to mix those I think with a client script. That part is using ServiceNow custom elements like <sp-cat-item> and <sp-variable-layout> etc.
Without going to deep and looked. I would say best option would be to customize the Server script on the widget and perhaps be able to manipulate the order field from there.. but it's a lot of work for 2 variables in one item. I would rather just create them manually instead.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-05-2018 02:54 PM
I did just that. Recreated the variables. Had to update the Catalog Task workflow items as well as a Business Rule, but no big deal. Thanks sir!