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

Notifications

Announcements

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)).

 

I have the same question (0)
  • Verified answer
    BhaskarDhone Profile Picture
    1,392 Super User 2025 Season 2 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,392 Super User 2025 Season 2 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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 721 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 320 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard