How to redirect users to Service Portal? | ServiceNow
hi everyone welcome back to my channel in this video I'm going to show a demo of how we can redirect the end users to the service portal rather than going into the classic native view of service now so when I say end users I name those users who do not have any role in service now now let's see how we can configure that before configuring that let's take a look whether it is by default enabled or not so this is the instance and I'm going to create a user without any holes so let's have to be a user table and I'm going to create a new user let's give a generic name which we can easily identify I'm going to give a test underscore end for now and I am not going to give any rules I'm simply going to click on submit button so we have this user which is configured named test underscore and and if I am going to impersonate this user now so let's see what happens so I have implicated this user successfully and this user has access to the sales service View and is in the classic servicenow view which is the native view also and this is not the portal view but we want to configure a redirection from here that this user once I impersonate this exam maybe when this user logs into the instance this this user should not be redirected to this view this user should be redirected to the portal view so now let's take a look at how that can be configured so first part of configuring this is we need to create a system property let's see whether that property is by default available in the instance or not so the name of my property is okay dot okay let's see if something comes up with this no there is no property that exists so we need to create a new property here and I'm going to enter the value right Dot entry Dot first Dot Page dot script okay this is the property and the value of this property is a function call which is part of a script include oh this is the name of my script include and as per the syntax we give new a keyword then the name of the script include and then the name of the function so this is the function that exists within this particular script include and let's save this and I think we are done so basically what is happening within this script include is they're checking whether the user is having certain rules or not if the user do not have any holes the user will be redirected to the service portal so let's take a look at this we have to include about how this is working foreign .com so this property will redirect the user to the native view if the user has any roles and if user is not specifically trying to hit the URL will take a look at the property in a moment but first let's take a look at the function which we are calling in our system property and so this is the place where most of the logic is happening at line number 69 and 70 where it is being checked whether the user has roles or not and so on and accordingly there is something which we can also configure based on what is the requirement from the client whether for specific kind of users we need to redirect to a certain portal and for some others we need to redirect to somewhere else so this is the place where we need to configure such things now let's quickly test it out whether it works or not so I am going to impersonate that user again and this time I should be inside the service portal when I impersonate this user so let's click on test end seems to be working yes so I am successfully able to get inside the portal so as an end user without having any roles I was redirected to the portal because I had that system property configured and out of the box it works the way it is working right now if there is some specific customization that needs to remain we need to do that in that particular script itself unfortunately I cannot click on end impersonation from here so let me quickly log out from here and go back to my login so here we are back with the admin login so I was talking about the client.login dot home property so let's see what exactly that property refers to foreign page is all about okay then let's pass the Sid here so as I said earlier if the user has roles and if user is not trying to specifically hit the portal UIL then the user will be redirected to this particular page which is configured as part of this UI page and this ID is mentioned in that glide.login.home system property so let's click on try it so this is the page actually when we first log in this is the page we get and thank you for watching bye
https://www.youtube.com/watch?v=E8U8rIo2utg