Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Unanswered

Bad Gateway for On-Demand Document Library Trigger

(0) ShareShare
ReportReport
Posted on by

Hi all,

 

I'm trying to build a Flow that is triggered by using the on-demand button in a SharePoint document library as described here: https://flow.microsoft.com/en-us/blog/flow-in-spo-document-libraries/

 

However, I'm getting a "Bad Gateway" error on the "Get Item" step.  Here is the message returned:

{
"status": 502,
"message": "Unknown Error",
"source": "https://<SITEURL>.sharepoint.com/_api/SP.APIHubConnector.GetListItem(listName='<LISTGUID>',itemId='<ITEMID>')",
"errors": [
"-1",
"Microsoft.SharePoint.Client.UnknownError"
]
}

 

I've given this a try on a SharePoint List (not Library) and it seems to work fine.

 

If you have any idea on how to resolve this, I'd very much appreciate it.

Thanks!

  • Community Power Platform Member Profile Picture
    on at
    Re: Bad Gateway for On-Demand Document Library Trigger

    Hi - any other ideas?  I've tried many different things, but I keep getting a 'Bad Request' error whenever I try to do a "Get Items" or "Get Item" action.

  • Community Power Platform Member Profile Picture
    on at
    Re: Bad Gateway for On-Demand Document Library Trigger

    Hi Michael,

     

    Here is the configuration.  I'm using one of the templates which automatically added the "Request" and "Get Item" steps.  From my understanding, this is required to have the Flow appear in the toolbar in the document library (see the screenshot below).  If I change the "Get Item" to "Get Items" or otherwise, the flow will not appear in the document library toolbar.

     

    Here is the Flow Configuration and error:

     

    And here is the Flow that can be launched when selecting a file in the document library:

     

    Thanks

    Naheed

  • v-micsh-msft Profile Picture
    on at
    Re: Bad Gateway for On-Demand Document Library Trigger

    Hi @Anonymous,

     

    Please share your flow configuration here.

    Generally the SharePoint ->Get Item action would only work for SharePoint list.

    As there is a Item Identifier need to be noticed before use this action.

    When using the SharePoint ->Get items, there is no document Library could be selected from the List Name part, we need to choose Enter custom Value, then enter the Name of the Document Library.

    Doing it in this way should make it work to get the Metadata of the Document Library.

    See my posts in the following thread for more reference:

    Scheduled sending email with a list of files

     

    Regards,

    Michael

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Michael Gernaey – Community Spotlight

We are honored to recognize Michael Gernaey as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 566 Super User 2025 Season 1

#2
David_MA Profile Picture

David_MA 516 Super User 2025 Season 1

#3
stampcoin Profile Picture

stampcoin 492