Tag: PowerAutomate

Exception in Microsoft Teams Channel created using Power Automate / Graph API “Folder location for this channel is not ready yet, please try again later”

I was automating Teams private channel creation using Power Automate, and faced the below error when I tried to access the channel’s file location via graph API.

Folder location for this channel is not ready yet, please try again later

The Issue

Yes, the folder location is not automatically provisioned when a channel is created, because the SharePoint site will get created only when you hit Files tab from the UI after Channel creation.

This is by design.

Workaround

Executing the graph query /teams/{id}/channels/{id}/filesFolder on the private channel can mimic the files tab action from UI. However, it may not work on the first attempt, and will return a 404 response, you may have to try 3-5 times. So we need to use a catch for first attempt and then loop it until the the graph call succeeds. Please see the bow image for reference.

You can find the documentation for filesFolder request here. This issue exist for standard channels (Non-Private) as well. However, for standard channels, you only need to call the filesFolder request only once.

Hope this helps!!!

PowerAutomate: Teams Connector Fails to List TimeZones

Connector error saying cannot list timezones.

Recently, I faced a strange issue, I was trying to create teams meeting using cloud flow, and the connector’s create meeting step was not listing timezone and not allowing me to set timezone as a custom dynamic value. It was also giving a retrieval error message as shown below.

Could not retrieve values. The dynamic invocation request failed with error: {
  "error": {
    "code": "ResourceNotFound",
    "message": "Resource could not be discovered.",
    "innerError": {
      "date": "2021-10-28T11:49:20",
      "request-id": "a0e7df5f-d119-4534-a8c3-5332e6f8b906",
      "client-request-id": "a0e7df5f-d119-4534-a8c3-5332e6f8b906"
    }
  }
}.

The Issue

I was testing this using a service account, and this was working fine for my user account. I was sure from the beginning itself that it was going to be some permission issue. However, I had no idea what permission I should look for. Finally, I managed to find that teams and other Microsoft applications use the Outlook Graph APIS to retrieve timezones and languages. I tried calling the APIs using the service account and I could replicate the error response. Now, it’s clear that the user is missing the required permissions to call outlook graph APIs.

The Fix

I am not so proficient with outlook and I raised this concern with our internal outlook team and they fixed this issue. What I could gather from them is that, the service account’s online office mailbox was not correctly enabled , which then they enabled with proper permissions. If you face similar issue, checking the mailbox permissions could save you a few hours 🙂

Hope this helps.

Power Automate Import Failure: ‘GetTable’ failed with status code ‘Unauthorized’

‘GetTable’ failed with status code ‘Unauthorized’

Recently, one of our business users had left the firm, and handed over the canvas apps he was developing to his colleagues. There was one canvas app with flows that update SharePoint list. He had shared the app .zip file with the team and told, it’s a completed app and just needs to import to the target environment after creating the SharePoint list. So, the team didn’t bother much to collect further details about the source tenant where this was developed. He had created the app on a trail tenant which was tied with his account and was lost as soon as he left the firm.

But, the business users were unable to import the app and came to us with the below error.

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." }'.

The Issue

The issue here was the SharePoint site dependency. The definition.js files of the Power Automate flows had references to the old site and the current user does not have access to the original site, hence the flow was failing with error ‘Unauthorized’ even though, SharePoint connection was created in the target environment.

The Fix

The fix 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 exported zip file. We had to replace all the occurrence of the URL, list ID (defined under table) and view ID, and saved the definition.js file and copied it to the zip file. Importing the updated zip file worked.

{"dataset":"https://***.sharepoint.com/","table":"d2**826-e05a-4972-be****8","view":"**-27f2-4ace-a289-ef41a**"}

The Right Way

This is a known issue when moving PowerApps/ Power Automate to a new tenant. This behaviour is not consistent as some flows were imported with no errors and others were rejected due to Unauthorized exception on GetTable().

One way to avoid this issue, is to use variables instead of directly selecting the SharePoint site, list and view in the SharePoint actions inside your flow.

Another option is to use environment variables in your flow. This will also help us avoid direct SharePoint references in your flow.

Hope this helps.

If you know any alternate option to handle this, please let us know in the comments.

I Wish I Would Have Known #11: Unable to add Licensed Users to Power Platform Environments.

 Dynamics 365 Enterprise licenses does not include general purpose Power Apps capabilities. Dynamics 365 Enterprise users will continue to be able to run apps and portals that extend and customize the licensed Dynamics 365 application, as long as those apps and portals are located in the same environment as their licensed Dynamics 365 application. Custom apps or portals outside of the Dynamics 365 environment will require a standalone Power Apps license. In short, If a user A has only dynamics 365 license applied, then A can be added only to environments which has at least one Dynamics 365 App installed. Read more here.