In this guide we will show how to create a guest user in your Azure AD with Flow Designer.

Create a Service Catalog Item

Navigate to Maintain Items list in ServiceNow and click on the New button.

Maintain Item

Enter a name for the catalog item like “Create guest user”, select a catalog and a category for the item to appear to, give a short description and right-click on the grey bar at the top and select Save.

CI create guest user

Then scroll down and find the variables related list. Click on New, select type Single Line Text and set it to mandatory. In the Question tab set the Question to be “Email of the guest user” and the name to be “email” and click on Submit.

Variable email

Next add one more variable of type Single Line Text, set it to mandatory and in the Question section set the Question to be “Username” and the name to be “username”. Click on Submit.

Variable username

Add a new variable of type Single Line Text and set the Question to be “Redirect URL” and the name of it to be “redirect_url”. Click on Submit.

Variable redirect url

Then create a variable of type Reference and set it to Mandatory. In the question tab set the Question to be “Domain” and the name to be “domain”. On the Type Specifications tab select the reference to be Domain[x_autps_active-dir_domain] and click on Submit.

Variable domain

Lastly create a variable of type Single Line Text and set the Question to be “Message” and the name to be “message”. Click on Submit.

Variable message

Create Flow

Before we can complete the Catalog Item we will create a Flow to complete the request. Navigate to Flow Designer anf create a new Flow. Give a meaningful name to the Flow and select Run ad System User.

Flow guest user

Select as a trigger the Service Catalog and click on Done.

Trigger Service Catalog

Then add the action from ServiceNow Core > Get Catalog Variables.

Get catalog variables

In the submitted request drag and drop the Requested Item Record from the data pill, in the template Catalog Items and Variable sets select the Create guest user Catalog Item we created before and from the available catalog variables select them all and move them to the selected list. Click on Done.

Get variables from create guest user

Next select the action from Rights Management App > Create Azure AD guest user.

create guest user

Drag and drop the catalog variables from the data pill to the corresponding fields in the create Azure AD guest user action. Then click on Submit.

create guest user action

Then select the ServiceNow Core action Update Record.

Update record

In the record field drap and drop the Requested Item Record, add a work note if you want and set the state to Closed Complete. Then click on Done.

Update record

Click on Save and Activate in the top right corner and your flow is ready.

Navigate back to your catalog item and in the Process Engine tab set the flow you created and right click on the grey bar at the top of the form and click on Save.

Create guest user CI

Now click on try it at the top of the form. Input the variables that are asked and click on order now.

Create guest user test

Here we can see the result:

Servicenow result guest user

Azure result guest user