ServiceNow Use Service catalog API to Submit request | ServiceNow Request Management demo
[Music] hi all and welcome back so there are a lot of people great people i will say on the now community who creates really great article and which those articles created uh give a great learning to us so today we'll be discussing on one of such article which is created by cycloma and which you can see on the screen so this article talks about how we can submit a catalog request using service catalog apis okay and this particular article i i find it very useful because whenever i am working on a catalog items okay it's really tedious for me to every time whenever i'm doing trying an error to go back to the service catalog go to the service portal create a request and all those things if i want to verify certain things on the back end so what this particular article talks about is like how we can submit request item okay using a service catalog api and i will give you a demonstration for the same first of all thanks a lot for creating such a wonderful article so let's get started so for example if i want to submit a request or i will go to maintain items let's take some some example so for example we want to uh raise request for standard laptop and we'll be doing it from the rest api explorer okay we will i will be showing you step by step so it has couple of variables you can see over here the variables how do we want to do you want to install adobe acrobat do you want to install photoshop and all the things and i'll get the packet name also for the same so if i go with your display name also and what is the first name for the same hmm to i think this is the one name about it so i will take display name and name so that we will get the backend because we will be driving everything from bracket right so we want to know what is the backend value for the same so these are the back and when aims let's get started so first step is like we have to go to rest api expo so let's go to that explore index our main intention from this uh tutorial is like we want to create a request item from the request rest api explorer without any intervention on the service portal or catalog native view anything like that so over here in the name space you can go for sn underscore sc which is with stand for service catalog so this will give the list of all the apis which are created internally out of the box for service catalog and as you must be knowing that whenever we use any catalog item there are two steps one is like we add the add all the components to the card okay whatever we want to order for okay we add it to the card and then we submit the request we'll be doing the same two state approach okay for this also we will be adding it to the card first and then we'll be creating a request out of it so just let's check there are a lot of a lot of epas okay for the same but we will be looking for add item to the card because as a first step we want to add we want to fill the cart okay now it asks for the attribute called society now what this recipe talks about what exactly this is so we want to raise a request for this particular catalog item so it asks for this id of this catalog item so i will take it from here you can do right click and do copy ssid also and i will be putting it over here now the second step okay is to create a request body request body is also pretty simple we will go to the raw okay and we will copy the format which is given by sign okay then i will explain you what exactly there what exactly is there okay so basically it has couple of attributes so the first attributes talks about cis para quantity so how many quantity for example this particular catalog item is for standard laptop so how many laptops you want to order one two three four so you can give any integer but it should not it should be non-negative okay because negative integer doesn't make any sense then the second is a json object okay inside the json which calls variables which refers to which points to the variables which are created on the catalog form so as i've shown you earlier if i go back and to the catalog item and you can see there are variables like acrobat photoshop okay and additional software requirements so the same are used over here so whenever you are working with other catalog items also so you can define the attributes of variables which are there for that particular guideline item no display value it should be a backend name okay so i've given yes i want to install acrobat readers also i want to install photoshop also and in additional software requirement i just gave some description because this open text field now will run this out so if i send this out let's see what happens so we got a response 200 that means everything is okay this is our request body okay we got the cart id also okay this is the card id these are subtotals all these things okay catalog item id and all this thing now does it mean that we have added things to the cart and it it must have created a request item let's verify that also so for that we will go over here and you must be knowing the bracket name for request setup so it's sc underscore request and let's go to item dot list sorry i'm actually i use a lot of shortcuts while using so yeah so you can see we ordered the add to cart api but it didn't create any request item why didn't create a request item because whenever uh whenever we add two things to the cart it doesn't make any sense till the time we submit that order okay so the next thing what we have to do is like submit order so we'll go back to the rest ap explorer and we will start searching the another api so what the another api should be it should be submit orders let's go and find submit order now the cart is already filled okay now we are just submitting the order so if i scroll down up up so i got a catalog i got an apa called submit order now this particular epa doesn't ask you for input any input parameter why because it's a session best thing for this particular session the cart is already filled now it consider that it will be performed in the action of you what exactly your ui action performs on the catalog form which is submit so we will be simply nothing to be filled over here will be simply submitting the order so i will send it out yes i want to modify the data and ideally it should go well so we can see 200 okay everything goes well it states that request item got created and request id is this okay so let's take this request request and see if our request got created so i'll go back i will just go to global search and find it created the request wow now let's see whether everything is good with this particular request so we will check what things you should check in order to verify the things so first is show workflow whether the workflow is attached properly it's everything is good with the workflow or not so i did show workflow it's loading the workflow and it seems the workflow has been attached okay so no issues i can see if if it gets loads okay if it gets load then there is no issue with the workflow so as you can see yes the request got said requested everything so everything seems fine over here and we have approval also triggered we will verify that also so let's verify the approvals also see if i scroll down yeah the pros also requested perfect now we will go to the request item to see if the request item is fine we'll go to the request item the request item till now everything seems to okay we have raised the request for standard laptop this is also perfect and variables whatever we have set acrobat adobe acrobat is true photoshop is true and also whatever we have provided as a software requirement description so everything seems to be working fine right so this is the way which you should use when you are doing a lot of iterations a lot of testing uh on a development side not when you are a tester okay and double as a developer to just submit the request and see how exactly it's working i'll be this is a use case for me maybe there is another use quiz for you right but i find it pretty useful so thanks a lot psy again hope you all like this video okay hope you will be using this api somewhere in your project okay and please please keep on creating this kind of content which will be helpful for others like me
https://www.youtube.com/watch?v=kGsCe9JDMJ8