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

kent_harwell
Giga Contributor

Hi Jesper,

Did you ever find a solution for this coding question? I have a different but similar need to include and make specific catalog items mandatory through an order guide variable.

Hi kent, 

No. I submitted an idea on the idea portal: https://community.servicenow.com/community?id=view_idea&sysparm_idea_id=7d21a87edb464054414eeeb5ca961920&sysparm_idea_table=x_snc_com_ideation_idea&sysparm_module_id=enhancement_requests

Nothing has happened since.

It actually just came up the other day again, as our users are not happy about the way it works. To install software you have to go to our Service Portal and find your software. If you do not search for the software, then you will have to browse for it... That means going into the catalog, selecting the category and then you get all the available software as tiles.
The problem is that on this page you would see 9 tiles at a time. You can then click the "more" button, which will give you 9 tiles more. But we have hundreds of software packages (and a new request to add hundreds more), so that is really stupid made. And no filter or sorting options within the catalog categories. 

I've been puzzling with the idea about the order guide again.. thought about implementing a business rule for adding a new rule base in a specific order guide for software ordering, each time a new software package is created in ServiceNow. So the idea is to have one order guide for requesting software for the end-user - here you would select the software from a list (which would show more than 9 objects at a time - and hopefully with some search functionality) and then go to next page to fill in the detals and submit the request.

But it requires some time to revisit this.. we're just too busy 🙂

I'm all ears if you have any ideas!

Kr / Jesper

themasterofthec
Tera Contributor

Hi Jesper / Kent

 

I have added the Script field to the Order Guide form and added the line guide.add("e48720f02fd32010a81b532a2799b6b4"); Worked for me

I save Order Guide variables on the cart record via Ajax, this can be used in the Order Guide script to determine which cat item to be included.

 

find_real_file.png

 

Hi,

If you don't mind me asking, for your last sentence you said:

"I save Order Guide variables on the cart record via Ajax, this can be used in the Order Guide script to determine which cat item to be included."

Can you explain this piece a bit more, please?

Thanks!


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

Hi Allen,

I have created a Catalog Client Script on the Order Guide. Whenever I change a Order Guide variable I call a Ajax Script Include to save the variable against the Cart record.

I saved the information in a JSON format in a Text field.

In the Order guide script I can read the Cart record, parse the JSON and determine which Catalog Item I want to include.

 

var cartRec = new GlideRecord('sc_cart');

if (cartRec.get(current.sys_id)) {
    try {
        var json = JSON.parse(cartRec.u_var_json);
		if (json.new_account == "Yes") {
			guide.add("5e18804b2fdb6410a81b532a2799b62c");
		} else {
			guide.add("a238844b2fdb6410a81b532a2799b6e1");
		}
       
    } catch (e) {
        

    }

}

 Hope this make sense!