web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Passing File IDs from ...
Power Apps
Answered

Passing File IDs from Power Apps to Power Automate and merging into PDF, then send an email

(1) ShareShare
ReportReport
Posted on by 4

Hello,

I'm working on a PowerApps application that allows users to select specific files from a gallery (connected a sharepoint library), display them on a table for confirmation and then merge into a pdf to send to themselves. The process involves passing the IDs of the selected files from PowerApps to Power Automate, filtering the files based on these IDs, extracting the file content and merging them into a PDF.

I'm struggling with passing the IDs from Power Apps to automate. The flow reads the entire library (200+ items) instead of just the selected. 

The configuration for my PowerApp button to call the flow is:

MergePDF.Run(Concat(SelectedItems, (ID),",");

Notify("Export process started. You will receive an email once complete.", NotificationType.Success, 3000)).

 

help3.jpg
help.jpg
help2.jpg
I have the same question (0)
  • Verified answer
    BhaskarDhone Profile Picture
    1,398 Super User 2026 Season 1 on at
    One thing you are missing is filter query on your get files action, with value something like
    "ID eq 240 or ID eq 239 or ID eq 238 or ID eq 237 or ID eq 236 or ID eq 235 or ID eq 234 or ID eq 233" based on ID that you are passing to your power automate.
     
     
    You need to form your filter query dynamically based on IDs. For that you can follow below steps:
    1. Initialize new variable called 'FilterArray' of type string and empty value
     
    1. Create array of ID by using split function. ( You are already doing it)
    2. Apply Each on your IDArray Variable and append to string Formula is 'ID eq item() or ' don't miss extra white space at the end.
     
    3.  Remove extra or that gets added to the end using compose action and set that value back to the string variable.
    Compose Formula : 
    substring(variables('FilterQuery'), 0, lastIndexOf(variables('FilterQuery'), ' or'))
     
    4. Lastly use in your Get Files action and rese your workflow will remain the same
     
  • LK-05081640-0 Profile Picture
    4 on at
    @BhaskarDhone, it's saying "Action 'Apply_to_each' failed: The execution of template action 'Apply_to_each' failed: the result of the evaluation of 'foreach' expression '@variables('FilterQuery')' is of type 'String'. The result must be a valid array."
     
    Where is your compose component coming from on the second step?
  • BhaskarDhone Profile Picture
    1,398 Super User 2026 Season 1 on at
    In your apply to each you are using FilterQuery variable. But it should be an array of IDs.
    See this from your screenshots.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 875

#2
Valantis Profile Picture

Valantis 530

#3
11manish Profile Picture

11manish 432

Last 30 days Overall leaderboard