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.
Hello @wan237
Is the Flow inside a Solution?
Is the Flow being imported in the environment an "Update" or "Create as new"
Proud to be a Flownaut!
@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"
Okay, and are you importing as a new app? or as an update?
Proud to be a Flownaut!
I'm importing as new app
In your Error message I see
to API 'sharepointonline' operation 'GetTable' failed with status code 'Unauthorized'
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.
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
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.
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.
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)
@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.
@edumen I am so happy! For anyone else following along, here is how the update item looks.
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.
it works! thanks!
Join digitally, March 2โ4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!
User | Count |
---|---|
34 | |
15 | |
14 | |
13 | |
8 |
User | Count |
---|---|
40 | |
31 | |
25 | |
13 | |
12 |