cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Frequent Visitor

Failed to Import Flow

I was trying to import PowerApps from one environment to another. The import failed on Flow. The flow was working fine in the older environment. During the import process, It throws Unauthorized exception on GetTable() .

 

Error Messages is

 

 

 

<code>
Flow save failed with code 'DynamicOperationRequestClientFailure' and message 'The dynamic operation request to API 'sharepointonline' operation 'GetTable' failed with status code 'Unauthorized'. This may indicate invalid input parameters. Error response: { "error_description": "Exception of type 'Microsoft.IdentityModel.Tokens.AudienceUriValidationFailedException' was thrown." }'.
</code>

 

 

 

 

 

 
 

@Jcook kindly let me know if you know the solution.

 

Thank You in Advance. 

15 REPLIES 15
Super User III
Super User III

Hello @wan237 

 

Is the Flow inside a Solution?

Is the Flow being imported in the environment an "Update" or "Create as new"





Did I answer your question? Mark my post as a solution!

If you like my post please hit the Thumbs Up


Proud to be a Flownaut!


Check out my blog for Power Automate tips, tricks, and guides
FlowAltDelete




Frequent Visitor

@Jcook. I exported the PowerApp which contains the flow. I exported it using the export option on PowerApps, So it's not the solution. and It is "Created as New"

@wan237 

 

Okay, and are you importing as a new app? or as an update?





Did I answer your question? Mark my post as a solution!

If you like my post please hit the Thumbs Up


Proud to be a Flownaut!


Check out my blog for Power Automate tips, tricks, and guides
FlowAltDelete




Frequent Visitor

I'm importing as new app

Super User III
Super User III

In your Error message I see 

to API 'sharepointonline' operation 'GetTable' failed with status code 'Unauthorized'
  • Please check if the user has a SharePoint Online License and has appropriate permissions to create or read files in 'SharePoint Online'.
  • Are there any active DLP policies that are blocking any of the connectors in the flow?

I'm having the same issue, I have exported the Flow and PowerApp which use a couple of SharePoint lists and a document library. The steps I took were Using PNP PowerShell exported the 2 x SharePoint lists and Doc Library from the dev tenant and imported them all to a new Communication site on the target tenant Added a new service account user to the target tenant, gave it a license, and shared the Communication site with it with Edit rights Exported the Document Upload Flow from the dev tenant, choosing Create New option Exported the PowerApp with the same Create New option Imported the Flow, I got an error saying it could import so I would have to save it as a new Flow (despite the Create New option), I did this and it imported and saved ok. I amended the Flow to use the correct SharePoint library and to use the service account connection I tried to import the PowerApp, it asked me to select the Flow which I did and also to select the connection account.  I chose the service account and hit import. I then got the same error as above.

 

ErrorMessage.png

 

I don't know if its important but the import details screen seems to still show the account in the source tenant not the service account I select in the import process

 

ImportDetails.png

 

This should be easier surely?

@wan237 ,

I was getting the same error and was able fix it by updating the definition.js file in the exported zip file.

What I was trying to do is export a flow from one site and import it to another site using a different username.  The new username does not have access to the original site.   The definition.js had references to the old site and the import procedure was having problems authenticating. 

 

My solution was to edit the definition.js file and replace the SharePoint URL and List ID with the new site information.  The definition.js file is in the lowest folder in the exported zip file and is defined under parameters

 

"parameters":{"dataset":"https://<URL to SharePoint site>/","table":"B582B199-6500-4F76-8627-C08D770204A6"}

 

I replaced the URL and list ID (defined under table), saved the definition.js file and copied it to the zip file.   Afterwards I was able to successfully import the flow.

 

New Member

Hi @eshen ,

 

I'll give it a go and confirm if it works!

Frequent Visitor

I had this issue, when moving a PowerApp to a new tenant.

Bahaivior is not consistent as some flows were imported with no errors and others were rejected due Unauthorized exception on GetTable().

After trying some approaches, we ended cutting the tenant dependency on each step that has a SharePoint connection by declaring a vSiteUrl variable as first step in flow and using it instead choosing it fom sites list on every step needed, then we used an expression for the List name value: string('ListName').

As this PowerApp should be updated on each sprint, we decided to pass vSiteUrl as a flow parameter. This saved us many hours of updating SharePoint steps manually on every deploy, and most important, it took the blocking error away.

Below, a simplified example on how this approach looks like on Create, Update and Get Items.

Screenshot 2021-02-08 120635.png

 Screenshot 2021-02-08 120732.png

 

You may require use expressions to retrieve ouputs from theses steps as editor does not populate the dynamic expressions anymore. The standard way to reference values is: body('Step_name')?['Column_name'].

Hi @edumen 

I tried your approach of using vSiteURl and vListName variables.

This works great when I just use the Sharepoint getItem action in the flow.

However, when I try to use the UpdateItem action, the flow UI tries to examine the source SharePoint list definition, and fails.  Then it removes the definitions for the fields in the list, so I can't work out how to update a list item.

 

Were you able to get around this?

See how it changes 'Part Description' to 'Item' (and all the other fields disappear too)

Screen Shot 2021-02-08 at 5.28.40 pm.pngScreen Shot 2021-02-08 at 5.29.13 pm.png

New Member

@eshen 
Your approach saved me some time but didn't work all the time sometimes I needed to select the list again, sometimes not.

 

@jim_tribetechI have the same behavior unfortunately 😞

 

Anyone has the same? or a solution?

 

Hi @jim_tribetech, for Update Item you have to provide a json for new values in Item field, an advantage is that you have to provide values only for changed values and not for all as if you are using the standard way.  i.e.:
{

   "Status": "Completed"

}
Same applies to CreateItem.

Regular Visitor

@edumen I am so happy!  For anyone else following along, here is how the update item looks.  Screen Shot 2021-02-09 at 2.36.30 pm.png

You just enter the field names as text, then use the Expression part of the Dynamic content builder and type in the formula as displayed when you hover over the value you want.  Also, use the Peek Code option so you don't have to retype!  Too easy when you know how.

Screen Shot 2021-02-09 at 2.45.38 pm.png  

it works! thanks!

Helpful resources

Announcements
Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

New Super Users

Meet the Power Automate Super Users!

Many congratulations to the Season 1 2021 Flownaut Crew!

New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

MPA Community Blog

Power Automate Community Blog

Check out the community blog page where you can find valuable learning material from community and product team members!

Users online (24,880)