Skip to content
Browse Power Automate tutorials

Process marked SharePoint items from one Power Apps button on a page

Add a Power Apps button to a SharePoint page that runs a Power Automate flow for every list item people have marked, so that one click can generate many documents.

On this page
  1. Overview
  2. Before you begin
  3. 1. Copy the flow and change its trigger
  4. 2. Create the button app
  5. 3. Connect the flow to the button
  6. 4. Build the SharePoint page
  7. 5. Generate documents
  8. Plan for shared use
  9. Troubleshooting

The For a selected item trigger works on one list item at a time, so it does not help when someone needs to process a dozen rows. A practical workaround is to mark rows in a Batch column, then run a flow that handles every marked row.

This walkthrough adds the last piece: a small Power App with one button, placed on a SharePoint page beside the list. Users mark their rows in grid view, select Process marked rows, and the documents appear in a library.

Before you begin

You need:

As written, the batch flow supports one run at a time, counting runs of both the original flow and the copy you make here, up to 50 marked rows, and a list of up to 5,000 items. On a larger list, index Batch and turn on Pagination, as the batch tutorial describes, and try the flow and the page on a full-size copy of your list before you rely on them.

Requested Projects list with Batch and Single Item Convert columns

1. Copy the flow and change its trigger

Copying the flow lets you keep the original.

  1. In Power Automate, open My flows, select the flow’s menu, and select Save as.

  2. Give the copy a clear name, for example SharePoint Multi-Select to Document PowerApp, then select Save.

    Create a copy of this flow dialog noting the copy is turned off by default

  3. Turn the copy on, because copies are off by default.

  4. Select Edit.

  5. Delete the trigger, then add the Power Apps trigger When Power Apps calls a flow (V2).

  6. Select Save.

When Power Apps calls a flow (V2) trigger with no inputs, followed by Get items, Condition, Create new folder, Initialize variable, Apply to each, and Rows retrieved

You only need to change the trigger if nothing later in the flow uses values from the old one. In this flow, the first action gets its own items, so nothing else changes. If your flow uses values from the old trigger, the save shows an error. Replace those values before continuing.

The trigger needs no inputs here. The flow decides what to process by reading the Batch column. Keep the Condition that stops the run when more than 50 rows come back, before anything is made.

That check proves only that no more than 50 rows came back. It doesn’t prove that every marked row came back, because on a large list Get items can miss rows, as the batch tutorial explains.

Update item keeps its default run-after setting, so it clears a row’s mark only after that row’s documents are made. A row whose actions fail keeps its mark. If Update item maps other fields, as the batch tutorial’s step 12 does, it writes back the values Get items returned when the run started, so don’t edit marked rows until the run finishes. A cleared mark means a run processed that row. A row still marked after a run wasn’t processed by that run. Its actions failed, or the run stopped before reaching it. It may have been marked after the run started, in which case it waits for the next run. Or Get items didn’t return it, as the batch tutorial’s large-list note describes.

An empty view filtered to Batch = Yes shows only that no marked row is waiting. It doesn’t show that every row someone meant to include was marked, or that a row someone unmarked by hand was processed. If a run retrieves no rows while that view still shows marked rows, Get items didn’t return them. That can happen on a list with more than 5,000 items, as Microsoft describes.

2. Create the button app

  1. In Power Apps, create a blank canvas app. A responsive layout works, although this example has only one button.
  2. Delete any controls you do not need.
  3. In Settings > Updates, turn on modern controls and themes.
  4. Add a Button, center it, and set its text to Process marked rows. The screenshot in step 3 shows the label Generate Selected. Process marked rows says what the button does: it processes every marked row, not rows selected by one person.
  5. Set a small screen height, for example 100, so that the app takes little room on the page. With a fixed layout, Power Apps zooms the app to fit the web part, so in a narrow column a wide app shows small, with bars above and below, as in the screenshot in step 5.
  6. To match your site’s buttons, add a theme under Themes using the same color as your site.
  7. Name the app, for example SharePoint List Buttons.

3. Connect the flow to the button

  1. Open the Power Automate pane in the app, select Add flow, and choose your copied flow.
  2. Set the button’s OnSelect to run it. Use your own flow’s name in place of YourFlowName:
YourFlowName.Run()

No parameters are needed, because the trigger has no inputs.

App designer with the Power Automate pane and a Generate Selected button

  1. Save and publish the app.

  2. Select Share, then Copy link. If other people will use the page, add them here too.

    Share dialog with a data permissions note and Copy link

The dialog’s note is a useful reminder. People need access to the app’s data as well as to the app.

4. Build the SharePoint page

The Power Apps web part doesn’t yet support screen readers or keyboard navigation, so some people can’t use a button inside it. Sub-step 7 gives them another route.

  1. In Site contents, select New > Page, then Create blank.

  2. Add a one-column section at the top, and a section with a one-third left layout below it.

  3. In the left column, add the Power Apps web part. It’s listed as Microsoft PowerApps (Preview), and searching for PowerApps finds it. Paste the link into App web link or ID.

    Power Apps web part pane with the App web link or ID box

  4. In the right column, add the List web part and select your list.

  5. In the web part settings, leave Hide list controls off, since users need the command bar for Edit in grid view. Some versions of the pane show Show command bar instead, as in the screenshot. Make sure it’s on.

    List web part settings with the list, size, and Show command bar toggle

  6. Select a view that shows the Batch column. The example uses a view named Take Action.

  7. In the top section, add text that explains how to use the page. Include a link to the app itself, using the link you copied, for people who can’t use the web part. For example:

    To generate documents, open the list in grid view and set Batch to Yes for each record you want included. Batch is shared, so the button processes every marked row, including rows other people marked. Then select Process marked rows. If you can’t use the button on this page, open the app directly.

    Make “open the app directly” the link to the app. Opening the app from its link avoids the web part, but check the app with a keyboard and a screen reader before you rely on it. People can also run the original flow from the list’s Integrate > Flows menu, as described in the batch tutorial.

  8. Name and publish the page. Each user may see a prompt the first time, asking for the app’s permission to access their data. Select Allow.

5. Generate documents

Before you mark rows, remember that Batch is shared. The button processes every marked row, whoever marked it, so check the column for marks you didn’t make.

  1. On the page, select Edit in grid view in the list.
  2. Set Batch to Yes on each row you want, up to 50. Exit grid view when you finish.
  3. Select Process marked rows.

Published page with directions, the Process marked rows button in the web part, and the list in grid view with Batch selected on two rows

  1. Open your document library and refresh. Documents appear as the flow works through the rows, so give it time.

Project Requests folder, newest first, with Request-2 and Request-1 Word and PDF files from the latest run

  1. Return to the list. A row whose mark was cleared was processed. A row still marked after a successful run wasn’t, so select the button again.

The button doesn’t show the flow’s progress. A Notify call after Run() in OnSelect can tell people that their click registered, but not that documents were made. The list is the record of what happened. If more than 50 rows were marked, the run stops before making anything, every mark stays, and the flow’s run history shows your message.

Plan for shared use

The Batch column is shared by everyone. If two people mark rows at around the same time, selecting the button processes all of them. For a small team this is rarely a concern, but agree on how the page will be used, or limit it to the people who process documents. Separate batches for each person need a different design.

One run at a time. The flow is meant for one run at a time, whoever starts it and however. That includes the original flow in the list’s Integrate > Flows menu, which processes the same marked rows as the button’s copy. Nothing in either flow, the app or the page enforces it. Each row’s mark is cleared only after its documents are made, so a second run started before the first one finishes can pick up the same rows. Both runs then replace the same final files, and each Move file replaces its file on its own:

  • Both runs can succeed without an error. Each final file shows the run that last replaced it. When two runs process the same row, its Word file can come from one run and its PDF from the other, and the row may have changed in between.
  • If a row’s actions fail after its Word file is moved and before its PDF is, that row’s Word file is new and its PDF is from an earlier run, or missing if there was none. The row keeps its mark.

So let one run finish before anyone selects the button again or runs the flow from the list. Don’t edit marked rows while a run is in progress either, because Update item can overwrite the edit with the values Get items returned when the run started. After a run that failed or overlapped another, open both final files for each affected row and check that they match the row and each other. To repair them, wait until no run is in progress, mark those rows, and select the button once more. If that run succeeds, both files for each row come from it.

Before rolling out, test with a second account to confirm they can open the page, see the app, and run the flow.

Troubleshooting

SymptomLikely causeWhat to do
The flow reports an error after you swap the triggerLater actions use values from the old triggerReplace those values with the flow’s own data
The flow is not listed in the appIt uses a different trigger, or it is offUse When Power Apps calls a flow (V2) and turn on the flow
The web part shows a prompt to allow accessThe app needs permission to reach its dataSelect Allow
The app does not appear in the web partLink not pasted, or the app is unpublished or not sharedPublish the app, share it, and paste the link again
The list web part has no Edit in grid viewHide list controls is on, or Show command bar is offTurn Hide list controls off, or Show command bar on
The button works but nothing is generatedNo rows have Batch set to Yes, grid view changes were not saved, or more than 50 rows are markedCheck the values and the flow’s run history, then select the button again
Someone can’t reach the button with a keyboard or screen readerThe Power Apps web part doesn’t support them yetUse the direct link to the app, or the list’s Integrate > Flows menu
Only some documents appearThe flow is still runningRefresh after a short wait, then check the flow’s run history
A row’s Word file and PDF show different valuesTwo runs processed the row, or its actions failed between the two Move file actionsWait until no run is in progress, mark the row, select the button once more, and check both files

Companion video

Video: Trigger Power Automate Actions from a Power App Button in SharePoint! FOR MULTIPLE SELECTED ITEMS!!

If the player is blocked on your network, open the video on YouTube.

Need help applying this to your own setup? Read about consulting.