logo

NJP

How to map dropdown values on a record producer? | dependent value in service catalogs | ServiceNow

Import · Sep 05, 2022 · video

hi everyone welcome back to my channel and in this video I'm going to cover a couple of use cases where in first of all I'm going to show you how we can make use of lookup select uh box in the service catalog and secondly we'll also see how I can uh make use of the drop down values for a particular field on the table in the service catalog for example a cord producer the one of the best example for this is like we create uh service catalog forms for end users like report an issue or create incident wherein we uh give them an option to select or values or write down their thoughts in couple of fields like description category impact and so on but they do not have access to the actual incident module because that is a cost to the company if uh those people need to have the it license so let's see how we can accomplish this so before moving forward I'll show you like in incident form we have categories like an inquiry software Hardware these are the ones which are available out of the box and for every category there's a dependent subcategory so if I select software these are the options available and If I select Network the options will change and the previous previous ones are not visible now these are the ones which are visible now so this is the same way it should work in my record producer as well so to save some time I have already created a record producer at a high level but what what exactly I'm trying to do here is uh something that I still need to do though I have already created the record producer let me directly click on try it so this is the record producer that I have created by default requested for is getting populated as a logged in user category these categories are visible U I'll show you how I made them visible directly from the incident form category field and the subcategory also is visible in the same way but the problem is if I select inquiry help still all those subcategories are visible if I select let's say Hardware also again all the subcategories are visible so let's see how the category field is configured and how does it contain all those dropdown values which are there in the incident form so I have selected map to field so that once I save submit this record producer the values get saved into the category field in the incident table and this I have taken a select box map to the field category and you can see the category name is automatically populated and I have selected my choice table as incident and choice field as category so this is the reason I'm able to see all the category drop down values which are available in the incident form also on this record producer now let's go back and check for the subcategory F now when it comes to subcategory also I have done the same thing I have mapped it to the subcategory field on the incident form so that once I submit the record producer the values get saved in this particular field on the incident form and I am doing the same thing Choice table as incident and choice field as subcategory but there's one thing on incident form when I'm selecting category only the associated subcategories are visible because we have an option called setting a dependent value in the incident form that is referring the cisor choice table for the drop down value so I have already opened this Choice table in this next Tab and if I filter based on table like incident for subcategory you can easily see that it is mapped to one of the categories using this dependent value so with the help of this dependent value those fields are mapped like if I select Hardware only the ones related to Hardware will be visible if I select software only the ones related to the software will be visible in the subcategory dropdown but that option is not available to us when it comes to the service catalog part in the record producer so the way we are going to do that is instead of Select box I'm going to use lookup select box okay and the table that I am selecting here is sore choice because this is the table where all the drop down values are stored and on incident form also the values are shown from the sore Choice table only Now look up value field the value which will be stored in the back end is in my value field and what label should be shown label is that will be shown will be stored in the label field this one is the label field uh I don't have anything to do with the price and recurring price yes I want to include none now let's save this and we'll check how it works and I'm going to go back to my record producer now so if I expand my subcategory field it includes all the possible values present in theore ch table but I don't want that I want it specific to the incident table and the subcategory field so let's see how that can be achieved so I'm going to mention a reference qualifier here in my table is incident my element is subcategory uh and let's say I also add a condition for dependent value let me simply copy this query to save some time now I don't want to hardcode my category and that has to come here as a dynamic value so dynamically I can access it via current do variables do category so I think I'm done with my reference qualifier now and it should autop populate all the values related to the subcategory field rather than showing uh all the values okay on that table so this is my cord producer now it shows none which is expected because I did not select anything in the category if I select let's say inquiry help oh it still shows them so there's something which I'm still missing so let's go back to our category uh configuration sorry subcategory configuration we'll see what we have missed out over here so field mapping is done which has nothing to do with the drop down values look up select box Choice value label everything is set this also looks okay now there's one thing which I'm missing over here which is the variable attribute since I'm passing this uh category variable dynamically I need to pass it as one of my reference element also I mean I need to specify that as a reference element in my variable attribute so the way I can do that is there's an attribute called ref 12 elements so here I need to pass the category which means I'm specifying that my reference element should have an attribute named category so if I simply update this so I'm back on my record producer form it shows none which is expected because there's nothing selected in the category field if I let's say select inquiry help and then go to my subcategory something doesn't seem to be right again so let's go back everything looks okay to me so I think it should simply work fine [Music] okay I see it now typo my bad so let's see if I select some other category than the subcategory options are visible accordingly let's say if I select software accordingly the software subcategory options are available if I select netw then accordingly the network subcategory options are available so this is how we can map a drop down values from any of the table to the corresponding record producer form so thank you for watching

View original source

https://www.youtube.com/watch?v=4ur_fdsxsLs