> ## Content Index
> Fetch the complete content index at: https://brilaro.com/llms.txt
> Use this file to discover other available public pages before exploring further.

# Query Any SharePoint List from Power Apps with a Power Automate Flow Broker
- URL: https://brilaro.com/query-any-sharepoint-list-from-power-apps-with-a-power-automate-flow-broker/
- Published: 2026-10-07T04:05:01.000Z
- Updated: 2026-10-08T06:04:56.000Z
- Author: Neal
- Tags: Power Automate

A Power Apps data source is fixed at design time, and every one you add counts against the app's connection budget. A flow broker avoids both limits. The app sends a small request to one Power Automate flow, the flow calls SharePoint, and the app gets rows back as JSON. One flow can serve any site and any list, chosen at runtime.

This post builds the broker, calls it from a canvas app, and covers the settings that keep it secure and fast.

## When you need it

Reach for a broker when:

- The app reads from more lists than you want to add as data sources, and the connection count is starting to hurt load time.
- The site or list isn't known until runtime, for example when it comes from a config list.
- You want one controlled place to shape queries instead of formulas scattered across screens.

For a handful of fixed lists, the normal SharePoint connector is simpler. Use it.

## How it works

1. The app calls the flow with three text values: the site URL, the list name, and an OData query string.
2. The flow runs **Send an HTTP request to SharePoint** against that site and list.
3. The flow returns the `value` array as a single JSON string.
4. The app parses the string with `ParseJSON` and loads it into a collection.

The app holds one connection, to the flow, no matter how many lists it reads.

## Build the flow

Create an instant cloud flow with the **Power Apps (V2)** trigger and add three text inputs: `SiteUrl`, `ListName`, and `Query`.

Add **Send an HTTP request to SharePoint** and set:

- **Site Address:** the `SiteUrl` input, from dynamic content.
- **Method:** `GET`
- **Uri:**

```
_api/web/lists/getbytitle('@{replace(triggerBody()?['text_1'], '''', '''''')}')/items?@{triggerBody()?['text_2']}
```

- **Headers:** `Accept` \= `application/json;odata=nometadata`

The `replace` call doubles any single quote in the list name, so a name like `Bob's List` doesn't break the URL. Your input names may map to `text`, `text_1` and `text_2` as above, or to the names you gave them. Pick them from dynamic content to be sure.

Finish with **Respond to a PowerApp or flow** and add one text output named `Rows`:

```
string(body('Send_an_HTTP_request_to_SharePoint')?['value'])
```

The `nometadata` header keeps the payload lean, and `string()` turns the array into text the trigger can return. Use `body()` here to get the response body. `outputs()` wraps it in an extra layer, so the path to `value` changes.

The list-name expression above assumes the second input is the list. Adjust the numbers if you ordered the inputs differently.

## Call it from the app

Add the flow to the app, then run it. The flow name below is `BrokerFlow`:

```
ClearCollect(
    colItems,
    ForAll(
        Table(
            ParseJSON(
                BrokerFlow.Run(
                    "https://contoso.sharepoint.com/sites/Projects",
                    "Tasks",
                    "$select=Id,Title,Status&$filter=Status eq 'Open'&$top=100"
                ).Rows
            )
        ),
        {
            ID: Value(ThisRecord.Value.Id),
            Title: Text(ThisRecord.Value.Title),
            Status: Text(ThisRecord.Value.Status)
        }
    )
)
```

`ParseJSON` returns untyped data, so each field is read through `ThisRecord.Value` and converted with `Text()` or `Value()`. Wrapping the result in `Table()` is what lets `ForAll` loop over it.

The `$filter` runs inside SharePoint, so only the matching rows travel back to the app. You get the same effect as a delegated query, with the filter written by you.

## Drive it from a config list

Once the broker exists, move the site, list, and query out of your formulas and into a small config list. Each row holds one data source:

```
{
  "Site": "https://contoso.sharepoint.com/sites/Projects",
  "List": "Tasks",
  "Query": "$select=Id,Title&$filter=AssignedTo/EMail eq '{{User.Email}}'&$expand=AssignedTo&$top=100"
}
```

Before calling the flow, swap the token for the current user:

```
Substitute(cfg.Query, "{{User.Email}}", User().Email)
```

Now adding a data source to the app is a new row in the list, not a new connection and not an app update.

## Keep it secure

The flow's SharePoint connection decides whose permissions apply. By default the flow runs as its owner, which means every user of the app sees whatever the owner can see.

Open the flow's **Run only users** settings and set the SharePoint connection to **Provided by run-only user**. Each person then runs the query with their own SharePoint permissions, and rows they can't read never come back. Test this with an account that has less access than you do.

## Common mistakes

- **Everyone sees everything:** the connection is set to the flow owner. Switch it to the run-only user.
- **Empty result, no error:** the list name is the display name, not the internal one, or the Uri has a typo. Run the flow on its own first and read the output.
- **Slow or timing-out calls:** the query returns too many rows or columns. Add `$select` and `$top`. Power Apps waits roughly two minutes for a flow to respond.
- **Rows stop at the `$top` limit:** the REST endpoint returns one page. For larger lists, loop on `odata.nextLink` with a Do until action and combine the pages before responding.
- **Fields come back as blank:** a lookup, person, or choice column returns an object. Add `$expand` for lookups and people, and read the nested property in the app.
- **Single quotes break the call:** escape them in list names and filter values by doubling them.

## Recap

1. One instant flow takes a site URL, list name, and OData query, and returns the rows as a JSON string.
2. The app parses the string with `ParseJSON`, wrapped in `Table()`, and converts each field with `Text()` or `Value()`.
3. Move the site, list, and query into a config list so new data sources need no app changes.
4. Set the SharePoint connection to **Provided by run-only user** so each person sees only their own data.