Order guide - dynamic rule base for client software distribution

Jesper Slot
Tera Guru

Hi, 

In my company we use the Client Software Distribution integration with SCCM. We don't like how it appears on the portal - we got 100+ software items so you get a really long list, where you have to click "show more" xx number of times to see it all.

I'd like build an Order guide for this instead. My idea was to let the user select the software on the first page of the order guide and then fill in the related catalog item for the specified software on the next page.

I've build an order guide with a variable of the type "Lookup Select Box" for table: "sn_client_sf_dist_cat_item" - which is where the software items are located (the sc_cat_item table would also work, with some filtering). This seems to work fine when there are rule bases for it, but the problem is that I would need a rule base for each piece of software on the list, and this number grows all the time. We got another team for handling/creating the software items and they do not have access to modifying the order guide and I'd prefer them not to have, so ideally I was thinking there must be a way around this with a script. 

I've discovered that the order guide takes the script code: 

guide.add("sys_id of catalog item");

So adding this line will force the order guide to include the specified catalog item.
But here I lack some coding skills.. Can I combine this with the input from my variable? 

I've tried with numerous variations of:

guide.add("current.variables.variable");

but it doesn't work. I cannot fetch the variables from the Order Guide - and even if I could, the script field on Order Guides is running server side. So how do I pull the the value of the variable and insert into the guide.add(); ?

 

1 ACCEPTED SOLUTION

Andrew Albury-D
Mega Guru

Hey Jesper, 

I've had a read through you problem and before we start digging in to code and hacky solutions, have you taken a step back and considered that swapping a list of 100+ items for a single item with a list of 100+ options in a Lookup Select Box may not be the quick fix you are after?

Are there any other options to increase the usability of your catalog items rather than the solution proposed?

Have you considered: 

  • Pushing a Search-first approach to your catalog items / software? Make sure the Meta tags are accurate and users shouldn't need to look through a list of software
  • Make a Dynamic Category based on the most requested items? Surely there would be 5 - 10 or so software items that get requested more than anything else, so using the 80/20 rule you could capture most cases with a quick sort, and for the edge cases push to search
  • Create a useful and meaningful category tree? If you look at the items and think about how they could be categorised (e.g. Development Tools, Productivity Tools, etc) you may be able to come up with almost a decision tree in categories that each item could be placed in to make them easier to find.

There are always many ways to solve problems, and often the "let's fix it with code" response isn't going to get you the best outcome, and it adds maintenance issues of it's own. 

I hope this helps, 

Andrew

View solution in original post

20 REPLIES 20

Hi,

Interesting, thank you for posting that!

I was presented with a question the other day about someone trying to order the order guide via script, but wanted to still tap in to the variables in the order guide script itself (which runs as it's ordered), but wasn't sure how to do that as there is no access to things like: "current.variables", "guide.variables", etc.

I'll note this for the future and have marked your reply as Helpful.

Thanks!


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

jamesmcwhinney
Giga Guru

Has anyone had any luck finding a better solution to this?

It seems bizarre to me that ServiceNow would provide a order guide script functionality that doesnt allow access to the users variable choices.  Im not sure how this functionality would be useful without it (without resorting to workarounds like what has been discussed here).

For what its worth, it looks like the user's order guide variable selections are serialized in the field "current_guide_serial" in the table "sc_cart".

 

So I think it should be possible to access those values in the order guide script without resorting to using onchange and ajax etc.  Havent tried this yet though...

Hi,

I can understand your point to a degree, but honestly how long have you been using ServiceNow and are just now coming across the need for this and posting about it? Most likely awhile. Not really excusing them, but there's rule base and other features baked in to the order guide to access those values and do 'x'.

If you need to access them in the order guide script to then determine another action, then you have the method described above, that we spoke about, or you could use the current guide serial, but the issue there is that you'd still need to know what variables are what and what each value is. The method we talked about above, fills that in for you and helps walk it along.

You'd still need to query the cart, parse the serial, know the variable sys_id, know what the variable value is (if sys_id - i.e. reference field), etc. So still some work either way. If anything, going through the current guide serial is harder to do and would require far more code.

Once the order guide is completely submitted, fyi, you lose the cart record (just throwing this out there in case others were hoping this was some permanent thing).

Please mark reply as Helpful, if applicable. Thanks!


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!