logo
search
SharePoint Document Issues

How to Pass Selected SharePoint File IDs from Power Apps to Power Automate

Maira MehtabMaira Mehtab Sep 27, 2026 869 views

Question details

The user needs to correctly pass specific selected SharePoint file IDs from a Power Apps gallery to a Power Automate flow.

Product
Power Apps and Power Automate
Device & OS
not provided
Scenario
Triggering a flow to extract content and create a PDF from specifically selected SharePoint files in a Power Apps gallery.
Observed behavior
The Power Automate flow ignores the specific file selection and incorrectly processes the entire SharePoint document library.
Before you start

Ensure you have edit permissions for both the Power Apps canvas app and the Power Automate flow, and verify that your SharePoint document library connection is active in both environments.

Solution 1Recommended

Pass Selected IDs as a Comma-Separated String

Use the Concat function in Power Apps to format the selected file IDs into a single text string, which Power Automate can then split and filter.

Power Automate often struggles to interpret raw collections directly passed from Power Apps. By converting the selected items into a single comma-separated string, you can guarantee the data is received accurately in the flow. Once received, the flow can split this string back into an array to filter the exact SharePoint files you want to process.

1
Format the string in Power Apps

Select the button in your Power Apps gallery that triggers the flow. Update its OnSelect property formula to concatenate the IDs. For example: YourFlowName.Run(Concat(GalleryName.SelectedItems, ID, ",")).

2
Initialize the string in Power Automate

Open your flow in Power Automate. Add an 'Initialize variable' action right after the Power Apps trigger to receive the comma-separated string.

3
Split the string into an array

Add a 'Compose' action and use the split() expression to convert the string back into an array: split(variables('YourStringVariable'), ',').

4
Filter the SharePoint files

Use an 'Apply to each' loop iterating over the output of the Compose action. Inside the loop, add a 'Get file properties' or 'Get file content' action configured to fetch the SharePoint file matching the current ID item, allowing you to merge the PDF securely.

Community Support: For more specialized assistance with complex Power Platform expressions, consider posting your setup details in the official Microsoft Power Platform Community.
Free Microsoft Office alternative

A Simpler Way to Merge Documents and PDFs

Building complex Power Apps and Power Automate workflows to merge documents can be time-consuming and difficult to troubleshoot. If your end goal is simply to combine files into a PDF, WPS Office offers a free, lightweight, and highly compatible alternative with built-in PDF tools.

  1. 1. Download and Install: Install WPS Office for free on your PC or mobile device.
  2. 2. Open the PDF Toolkit: Launch WPS Office, navigate to the 'Tools' tab, and select 'Merge PDF' from the built-in toolkit.
  3. 3. Add Files and Merge: Select your downloaded SharePoint documents or local files, order them as needed, and click 'Merge'.
Free and lightweight Microsoft Office alternativeHigh compatibility with Microsoft Word, Excel, and PowerPoint formatsBuilt-in PDF toolkit to merge, split, edit, and convert documents instantlyFamiliar user interface for seamless migration and zero learning curve
microsoft office alternative - wps office

Frequently Asked Questions

Why does Power Automate process all files instead of my selection?

This happens when the flow trigger does not successfully receive or parse the specific item filter from Power Apps, causing it to fall back to the default behavior of retrieving all items in the targeted SharePoint document library.

How do I split a comma-separated string in Power Automate?

You can use the split() expression in a Compose action. The syntax looks like this: split(triggerBody()['text'], ','). This converts your string of IDs into an array that can be used in an 'Apply to each' loop.

Can I pass a JSON array from Power Apps to Power Automate instead of a string?

Yes, you can use the JSON() function in Power Apps to format a collection as a JSON string. In Power Automate, you will then need to use the 'Parse JSON' action to convert that string back into a usable array of objects.