The Now Platform® Washington DC release is live. Watch now!

Help
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
shawna
Giga Guru

ServiceNow Integration with Microsoft PowerApps and Flow

ServiceNow connector to Microsoft PowerApps and Flow is in Preview (Connector Reference). I thought I will give it a try to see how easy that ServiceNow can be integrated into Microsoft Cloud apps. Since there wasn’t much of documentation for this, so I wanted to share my experience here in case someone is interested in the steps:

  • How to create a ServiceNow connection in PowerApps
  • How to create a Microsoft Flow using the ServiceNow connection
  • How to call Flow from PowerApps

How to create a ServiceNow connection in PowerApps/Flow

  1. Launch Powerapps design Studio and create a New Connectionfind_real_file.png
  2. Search ServiceNow
  3. Typing your instance name and username and password.
  • I had to connect to the instance with a local account and I wasn’t able connect using my Azure AD account

After the Connection is created, you can use it in Microsoft PowerApps, Flow or Azure Logic Apps. I found Flow is a way better option than connecting directly via PowerApps, since you can easily debug the output in Flow. I think there are limits on how many calls you can make with Flow per month, so you might want to evaluate the cost if you decide to deploy this to production.

How to create a workflow using Microsoft Flow using the ServiceNow connection

  1. In PowerApps design studio, Go to Business Logic and Click Flows and Create from Blank
  2. Create a new Action and search for ServiceNow, select ServiceNow – List Records

 find_real_file.png

  1. Select the record type you want to pull from ServiceNow, such as Requested Item find_real_file.png
  1. Click Test
  2. Copy the result Array (starting and ending with square brackets) out into notepad. You will need this for creating output JSON Schema.find_real_file.png
  3. Next, add the Request - Response action as the output of the Flow
    • This step is necessary and important. I missed this step in my first try so I couldn’t get the response I expected in PowerApps. It just shows ‘True’ value as a return for the Flow in PowerApps. Even when I added this step later, PowerApps still couldn’t pick up the change. I had to recreate a new Flow with Response output and then PowerApps was able to consume the output. I think it is a bug in PowerApps.find_real_file.png 
  1. In Response Body, Click Add dynamic content and select result under List Records panel.
  2. Click Use sample playload to generate schema and paste the Array from Step 5find_real_file.png
  3. Change Flow name to Request Items find_real_file.png

Now you are ready to consume the Flow in PowerApps

How to call Flow from PowerApps

  1. In PowerApps Studio, create a new app and Select Phone layout under Blank app
  2. Add a Gallery, Select Blank vertical
  3. Add a Button and under OnSelect , paste ClearCollect(requests,RequestItems.Run()). This will create a “requests” collection, which then can be hooked into the Gallery control.find_real_file.png
  4. Select the Gallery, and under Items, type requestsfind_real_file.png
  5. Run the PowerApps, and Click the button, you should get requests back from ServiceNow.find_real_file.png
Comments
Angelo Mariani
Kilo Explorer

Hi @Shawna. You wrote: 

  • I had to connect to the instance with a local account and I wasn’t able connect using my Azure AD account

What do you mean by "Local account"? I tried to setup the connection from Powerapps using my account in the ServiceNow instance of my company, of course. What other account should I use? 

 

Thanks for your help in advance!
Bye,

A.-

shawna
Giga Guru

We have single sign on enabled for our ServiceNow instance and we can access our ServiceNow via our Azure AD accounts.

I was not able to use my Azure AD account to connect to the API, but a local admin account, which is only exist in ServiceNow but not in Azure AD, was able to. 

SC10
Kilo Guru

Getting the following error when setting up an action to ServiceNow:

find_real_file.png

Any idea why this is happening? The trigger list is empty.

 

Thank you!

Nickels
Tera Expert

There aren't any ServiceNow triggers for Flow at this time. So i assume you are connecting this Flow to a PowerApp, use the PowerApps trigger for the first step of the flow. After that you can use the ServiceNow actions and then also be able to call outputs from the Power app into the ServiceNow actions. Make sure to use Response action above that Shawna mentions.

find_real_file.png

Flow below:

find_real_file.png

SC10
Kilo Guru

I have the trigger and action setup, as well as the result as laid out. I am now in studio trying to create the app, but there is nothing coming up in my gallery when I click the button.

 

My flow is named "Enhancement Items".

 

The "Items" property of my gallery has a formula of "enhancements".

The "OnSelect" property of my button has a formula of "ClearCollect(enhancements,EnhancementItems.Run())"

 

What am I missing here? Where does the app tie into the Flow? Your formula had "RequestItems" in it, where is that coming from?

 

Thank you

 

EDIT: Could this be an issue? My Gallery wants me to connect to data, but when I go to make a data connection, the following is displayed. Checking my license with PowerApps, I am on a "PowerApps Plan 2 Trial":

find_real_file.png

EDIT 2:

Closing and re-opening the app, it looks to be pulling in data, but it is not displaying (look at the scrollbar):
find_real_file.png

 

Nickels
Tera Expert

You probably need to format the gallery. Since it looks like a blank gallery, try inserting a label and set it up to read the data. For example, I have a text label displaying 'Assigned To' and then another text label set to ThisItem.assigned_to.

 

find_real_file.png

SC10
Kilo Guru

I've done this, but still no data is coming up. I can confirm that it is making a connection to my PDI, however, as when it was sleeping I got a very obvious error that said it couldn't connect to the upstream server. I am no longer getting errors with my PDI awake:

 

find_real_file.png

 

EDIT: Spoke too soon, it's working now! Had to reload my app, after adding in the label with the thisitem.field. 

Do you know how I can grab a reference value's display value? I'd normally use .getDisplayValue() in ServiceNow, but this is not working in PowerApps.

SC10
Kilo Guru

Still looking for some help getting properties of my array into the gallery via ThisItem or similar. Anyone around?

 

Thanks!

Randall Arnold
Giga Expert

I can't find what to use for Instance Name.  I tried the values below and get an error:

find_real_file.png

Milan Gross
Kilo Explorer

I notice that the ServiceNow connector in Microsoft Flow designer (https://us.flow.microsoft.com) is still listed as "preview". Do we know when it is expected to upgrade to full production release?

Ronald13
Kilo Explorer

Hi Randall,

Just use the name of your instance (rydersystesdev) instead of the full URL.

Cheers!

Peter Mattsson
Kilo Explorer

Hi all,

I know this is an old conversation but I may have a simple solution. As serveral of you I also got empty collections in my PowerApp but when I changed to body instead of result in my response in Microsoft Flow I started to get the data in also. Please try that and see if you get the data.

find_real_file.png

Shashwathi
Kilo Explorer

Hi,

When I try to connect to the instance it says "Please check your account info and/or permissions and try again".

Can i please know what permissions or access should i have?

find_real_file.png

Allen Andre Ind
Kilo Explorer

Connection name should be your servicenow instance URL

Shashwathi
Kilo Explorer

Hi Allen,

Thank you for responding.

I tried using the URL in connection even then it is giving me the same error, is there any specific permission I should have in order to connect through logic app?

I am able to create,list etc. all the incidents when I open the URL through google chrome.

Could you please help me. Thanks in advance

Allen Andre Ind
Kilo Explorer

Hello Shashwathi,

I believe you need to have the system administrator account to be able to connect to flow, because that's what I did. 

find_real_file.png

In the connection name I copied and pasted the instance URL, and on the instance name I coped the name which is in my case "dev72802". Also, the username and password I used is of the system administrator. Hope that helps somehow. 

Have a good day!

 

Rajashekhar M
Kilo Sage
Kilo Sage

Hi @shawna 

 

Is there any way post RITM variables to Microsoft flow. Please respond to my thread.

How to post RITM variables to Microsoft flow using Rest call?

Thanks,

Rajashekhar Mushke

 

Nisha30
Mega Guru

Hi,

What exact permissions are needed for the account ?  certainly not ADMIN it has root power ?

Thanks

Nisha30
Mega Guru

What exact permissions needed ? Thanks

nikhil_001
Tera Contributor

Any update on which role is required for the user to create a request from power automate to servicenow

Randall Arnold
Giga Expert

as far as I know it's just ITIL

Ahmet1
Tera Expert

Hi, did you manage to find a way to add Variables for Catalog items? is this possible to populate variables in catalog items (Request Item table) from PowerApps integration?

Gustavo Soares
Kilo Explorer

Hello, How we can manage the integration with service now, per example insert new data with choice fields. There is any way to sync data or is better use the ServiceNow API's ? Thank you in advance.

Catherine16
Tera Contributor

Hello, 

 

Have anyone tried creating specific RITMs with multiple variable dependencies in ServiceNow using the ServiceNow connector in Powerapps? Is that possible in PowerApps? 

Also, does it not insert new unnecessary objects in ServiceNow as it has no field validations? 

 

 

baekelal
Tera Contributor

Hi,

 

Also want to use the servicenow connector from powerautomate. The connection looks succesfull ( connected) but i got following error: 

Operation Failed","detail":"ACL Exception Insert Failed due to security constraints

So i guess i need more rights yes ?

Anyone know exact what rights you need (except the admin role ofcourse) 

Luc11
Giga Explorer

I'm trying to create a connector from Powerapps (SharePoint) to ServiceNow to create an incident. I can connect to ServiceNow just fine but the ServiceNow guys says it creates the incident but does not populate the "company" field. It populates other fields but not that one. Tried different options in the company field but none of them seem to work. Any ideas? 

 

chercm
Kilo Sage

my company is using SSO and not allowing local account . is there any way to make use of rest API to connect to service now from powerapps?

John Trierweler
Tera Contributor

1) MUST use a local account - does not work with SSO
2) Local account must be a full admin account

 

Version history
Last update:
‎07-06-2018 11:45 AM
Updated by: