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 Microsoft 365 Junction, Speaker, Author, Learner, Developer, Passionate Techie. Certified Professional Workshop Facilitator / Public Speaker. Believe in knowledge sharing. Around 20+ years of total IT experience and 17+ years of experience in SharePoint and Microsoft 365 services Please feel free me to contact for any SharePoint / Microsoft 365 queries. I am also very much interested in behavioral (life changing) sessions like motivational speeches, Success, Goal Setting, About Life, How to live Life etc. My book - Microsoft 365 Power Shell hand book for Administrators and Beginners and 100 Power Shell Interview Questions - https://www.amazon.in/Microsoft-Administrators-Beginners-Interview-Questions/dp/9394901639/ref=tmm_pap_swatch_0?_encoding=UTF8&qid=1679029081&sr=8-11

You may also like...

Leave a Reply

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