Power Automate – resolving error – Could not retrieve values. The dynamic invocation request failed with error. Invalid hostname for this tenancy

fig : Power Automate - Error while fetching document libraries for given location / site
fig : Power Automate - Error while fetching document libraries for given location / site

Hi All,

Greetings for the day!!!

Today new issue and solution 🙂 Small learning!

Background / Use case / Details :

  • We need to get the excel file worksheet in one of our Power Automate
  • We are using “Get worksheets” action from “Excel online (Business)” connection
fig : Power Automate - Adding action "Get worksheets"
fig : Power Automate – Adding action “Get worksheets”
  • For demo purpose I have created “Instant cloud flow” so that can trigger manually and test
  • Next, added “Get worksheets” action
  • Get worksheets” action requires to select “Location” and then respective “Document Library
  • Here “Location” can be site and we are specifying site URL – https://knowledgejunction1.sharepoint.com/sites/Demo/Space%20In%20URL
Power Automate - Adding action "Get worksheets"
fig : Power Automate – Adding action “Get worksheets”
  • As we are specifying URL it should resolve the URL automatically and load the respective document libraries from the site but an error is getting as
Power Automate - Error while fetching document libraries - Get worksheets action
fig : Power Automate – Error while fetching document libraries

Issue / Error :

Could not retrieve values. The dynamic invocation request failed with error: {
“error”: {
“code”: “invalidRequest”,
“message”: “Invalid hostname for this tenancy”,
“innerError”: {
“date”: “2023-03-28T10:12:28”,
“request-id”: “4567a025-c002-4347-a185-494ee44c623c”,
“client-request-id”: “4567a025-c002-4347-a185-494ee44c623c”
}
}
}

fig : Power Automate - Error while fetching document libraries for given location / site
fig : Power Automate – Error while fetching document libraries for given location / site

Solution / Cause

  • Here, reason for the error is – location / site url – we are specifying
  • Encoding / special characters available in site URL – %20
  • As we remove these special character and specify the location / site url again document libraries loaded successfully 🙂

https://knowledgejunction1.sharepoint.com/sites/Demo/Space In URL
fig : Power Automate - After removing special characters from Location / Site URL - libraries loaded successfully
fig : Power Automate – After removing special characters from Location / Site URL – libraries loaded successfully

Thanks for reading!!! HAVE A FANTASTIC TIME AHEAD 🙂

Prasham Sabadra

LIFE IS VERY BEAUTIFUL :) ENJOY THE WHOLE JOURNEY :) Founder of Knowledge Junction and live-beautiful-life.com, Author, Learner, Passionate Techie, avid reader. Certified Professional Workshop Facilitator / Public Speaker. Scrum Foundation Professional certificated. Motivational, Behavioral , Technical speaker. Speaks in various events including SharePoint Saturdays, Boot camps, Collages / Schools, local chapter. Can reach me for Microsoft 365, Azure, DevOps, SharePoint, Teams, Power Platform, JavaScript.

You may also like...

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: