Small Tricks and Tips – PowerPlatform – PowerAutomate – related to SharePoint online Hyperlink field – resolving error – BadGatway / URL is not for this web

Power Automate - action "Get file content using path" - error while reading image field from SharePoint online list - BadGateWay
Power Automate - action "Get file content using path" - error while reading image field from SharePoint online list - BadGateWay

Hi All,

Greetings for the day!!!

Today new issue and solution.

Use Case / Background

  • We have a Power Automate reading the items from the sharepoint list
fig : SharePoint online list - Newsletter
fig : SharePoint online list – Newsletter
  • Our SharePoint Online list have a field of type – Hyperlink or Picture
fig : SharePoint Online - List having field of type - Hyperlink or Picture
fig : SharePoint Online – List having field of type – Hyperlink or Picture
  • In Power Automate we are reading our list – “Newsletter”
fig : Power Automate - action "Get items" - reading items from "Newsletter" list
fig : Power Automate – action “Get items” – reading items from “Newsletter” list
  • To render image field in outlook, we need to read the content of file
  • To read content of file we are using action – “Get file content using path“
fig : Power Automate - reading image content - using action - "Get file content using path"
fig : Power Automate – reading image content – using action – “Get file content using path”
  • We are using “Dynamic content” – “Image” field from previous action – “Get items” as shown in above figure
  • While reading content of file using “Get file content using path” – we are getting an error – BadGateway

Error / Issue

BadGateway

{
  “error”: {
    “code”: 502,
    “source”: “india-001.azure-apim.net”,
    “clientRequestId”: “393c7c84-aeae-431d-8bd3-dcc6c70cb55a”,
    “message”: “BadGateway”,
    “innerError”: {
      “status”: 500,
      “message”: “URL is not for this web\r\nclientRequestId: 393c7c84-aeae-431d-8bd3-dcc6c70cb55a\r\nserviceRequestId: 393c7c84-aeae-431d-8bd3-dcc6c70cb55a”
    }
  }
}

.

fig : Power Automate - action "Get file content using path" - error while reading image field from SharePoint online list - BadGateWay
fig : Power Automate – action “Get file content using path” – error while reading image field from SharePoint online list – BadGateWay

Solution

  • Issue is related with the way we are specifying the URL in image field
fig : SharePoint Online - URL specified in Image column of type - HyperLink or Picture
fig : SharePoint Online – URL specified in Image column of type – HyperLink or Picture
https://knowledgejunction1.sharepoint.com//:i:/s/Demo/EdXn4h3C9ntCmFU8l9I0Ow4B7ovKz4UNmDvxZOB9yC-x3g?e=79WivJ

  • Actually we need to specify URL in following given format

https://knowledgejunction1.sharepoint.com/sites/Demo/SiteAssets/sharepoint.png

fig : SharePoint Online - specifying correct image path in Image field
fig : SharePoint Online – specifying correct image path in Image field
  • If then we run Power Automate it ran successfully as
fig : Power Automate - ran successfully when we specify the correct URL in image field of SharePoint online list
fig : Power Automate – ran successfully when we specify the correct URL in image field of SharePoint online list

I hope this will save your time. 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.