logo

NJP

Salesforce Integration With ServiceNow

Import · Feb 19, 2020 · video

hello hi we want so this video is all about how we can do integration between ServiceNow and Salesforce in this case here ServiceNow is gonna act as a consumer and Salesforce is going to act as a service provider what we are going to try to achieve in the end of the video is to send two differents rest requests the first one is going to be get the profile information in here it's going to be my profile information the second one is going to be create a record in service now we're gonna select the table there and we're gonna create an account okay so there are two prerequisites the first thing have your developer instance for Salesforce you can get a free developer edition all you need to do is to sign up for an account here developer dot salesforce.com and the second thing understand what is what authorization grande flow I do have a sort of documentation that I can link in the video below that one is a website that I can that I'm using actually different how to understand for example the authorization code grant flow we have clear explanation here it's well-written documentation you can use that otherwise you can use your whatever you can find okay so yeah so let's get started the first thing what we are going to do is doing the configuration in Salesforce so we're gonna create what we call a connected app so this is the platform that I have and click on here and then look for setup so I'm going to click on setup it's going to open up a new page and look for app manager click find type here okay manager so you can find it under apps app manager and we're gonna create it you want so new connected app give a name my email address okay now enable about setting this is the most important part so make sure that you provide you the callback here so whenever we create a what profile in service now you will get for example the callback here so I have already here in my notes - I'm gonna trick you use them because it's always the same URL so I'm gonna use which is called the redirect URL so which is here called callback URL and and you have all this available scope that you can actually use in order to perform different action for example accessing my basic information I should have this one in the selected what scope so I'm gonna select all of them and then use it okay so that's all you need to do so I'm going to save it and I have around 2 to 10 minutes to have this app connected I mean valid so I'm gonna click on continue great so you have two different information which is highly important you have the consumer key and consumer secret which you are going to use when you are going to do the contrary on the other hand so let's start to do our configuration in service now so I'm gonna connect here okay so try to find in the Navigator system or odd and look for application registry and create a new one and this time is going to be connect to a tool party or providers so I'm gonna click on that and here the first thing is a key give a name that you want that you can actually Salesforce client ID is the one that we have in here this text client secret is the one that we have also here okay and then we need three different information authorization you are talking your read application URL so the grant type is authorization code so I'm going to choose that one here so how we can get these URLs all you need to do is look for and there is an article I guess is this this one and here we have all the information so you have the authorization URL token your location your also some other your URLs that we can use in our to get the profile information or do some other actions okay so I'm gonna just use the first three so first one is the authorization [Music] so perfect we do have all the information that we need the grant type is selected now I'm gonna just submit it's gonna create a profile okay so I don't have my profile I should also include all the entity scopes which is the scope that we add when we were actually managing the app all these scopes so in order to do that I can just go here and I have another article here or tokens and scope I've just these are the scopes I will just copy paste everything okay summit sorry update then I'm going back to Salesforce but I have to make sure and oh I have to select again why and I have to make sure these scopes they are appearing here if they are not appearing I have to search like by like this I have to add okay great so we have done with the configuration on citizen outside we need to create now two different rest message rest requests the first one is going to send a request to get the profile information so let's do that and then check if it is going to work or not so I'm going to create a rest message and I just make sure once more if everything is good here you can see credit all the URLs here authorization code okay so the end point the end point is is the one that we can actually use is this one okay this one is going to give me the user information get access or refresh token available so what I'm going to do first get the token so let's see what's gonna happen I'm getting something great I'm having this page which is saying hey this application that we have created so it's now app there is try asking these access so all you need to do is allow now we should have any token that we can use in order to access now to send a rest request so I'm going to click on default get and click on test and see what's going to happen as you can see here I have a 3 DB status 200 which means it's successful and I do have my profile information I have my profile ID organization ID my preferred username which is the one that I use in how to connect to Salesforce which is Karthik at Koh or something and my first name here for example last name the email ID okay so this is working perfectly the first request let's try to do the second one which is actually creating a record in here I'm going to show you the table so I want to create an account here so as you can see now it's completely empty we don't have anything so what I'm trying to what I'm going to do here is to create one record with and it will have an account name so these how to send the request we do have some documentation and probably hold on integration and API rest api developer guide and here we have some examples of risk requests that you can send and working with through cards and i'm gonna click on create record that's what we are going to do and this is kind of cool request but you can actually look how it is built and send your Rasmus age HTTP requests as they can as you can see here we have a URL which is my instance URL plus some other information like services data and so on so I'm gonna use this one so I have already here so I replaced it by the one that I have EU 29 force so I'm gonna just take that one create a new record here new sorry rest request so this one is going to be a post in point header this is the most important the first time when I have tried I missed a inform what we should have in the error if you don't have any information here it's not going to work so make sure that you should follow what is written right here so we do have here the content type which is application Jason so I'm gonna just provide that information here okay right and also the what we should have in the request body so I'm going to take that this part of the questioning click here we don't need the three this one okay so we have everything so I'm gonna submit okay so now I'm gonna show you just before sending the request that we do have nothing on the account here the service accounts we have nothing so I'm gonna send a request to see if it is going to create an account with the following name the name it should be Express logistics and transport okay test so so I do have some sort of mistakes so what I have Express it may say it's cannot desert as instance of string value from so it's not able to I'm going back here something to do with miss okay yes okay again update test okay this time I have success true I have an ID which means it's created properly in Salesforce let's let's now test if it is if it is working or not so I'm going here and you can see here I have expressed logistic and transport it's created it's pretty much empty because we didn't send other information but we can see the integration is working perfectly and we can do much more things it's not just creating a record we can update a record so you can find all these information right here so these are different examples so this is just a video to show you how we can successfully do an integration between ServiceNow and Salesforce and Salesforce as a service provider and ServiceNow as a consumer thanks for watching hope you enjoy bye

View original source

https://www.youtube.com/watch?v=hcYof845-dQ