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 / need help with using m...
Power Apps
Unanswered

need help with using multiple attachmentcontrols

(1) ShareShare
ReportReport
Posted on by Microsoft Employee

i need to be able to use multiple attachments controls for file upload so i can activate them all at once with one button press.
this is my current formula for a single attachment control:

ForAll(
DataCardValue3_1.Attachments As Document,
'PowerAppV2->Createfile'.Run( {file:{
contentBytes: Document.Value,
name: Document.Name
}})
)

Categories:
  • Pro_User_365 Profile Picture
    546 on at

    Hi  @Anonymous,

    To use multiple attachment controls for file upload with one button press, modify your formula to iterate through each attachment control. Assuming you have controls named DataCardValue3_1, DataCardValue3_2, etc., you can use the following formula:

    ForAll(
     Concatenate(
     DataCardValue3_1.Attachments,
     DataCardValue3_2.Attachments,
     ... // Add more controls as needed
     ),
     'PowerAppV2->Createfile'.Run(
     {
     file: {
     contentBytes: Document.Value,
     name: Document.Name
     }
     }
     )
    )

    This formula concatenates the attachments from all specified controls into a single list and then uses ForAll to iterate through that list, running the 'PowerAppV2->Createfile' for each attachment.

     

    Give this a try, and it should help you upload files from multiple attachment controls with a single button press. 😊 Regards! Ali Shahzad

     

  • Pstork1 Profile Picture
    69,665 Most Valuable Professional on at

    to add to @Pro_User_365 's reply, which will run the flow once for each attachment. The only way to pass an array of attachments into the flow would be to put it inside a JSON() function and pass the array as a string. Then inside the flow you would need a Parse JSON to reconstitute the file array.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    hello ali shahzad

    i put it into my powerapp but i got multiple errors from it
    invalid number of arguments recieved 1 expected 2
    the function concatenate has some invalid arguments
    invalid argument type (table) expecting a text value instead
    run has invalid arguments
    incompatible type the 'file.contentBytes'column in the data source you're updating expects a 'blob' type and you're using a 'Error' type

    name isn't valid 'document' isnt recognized

    this is al i got from it basically everythoing has a red line under it

  • Pro_User_365 Profile Picture
    546 on at

    Hi @Pstork1 ,

    To use multiple attachment controls for file upload with one button press, modify your formula to iterate through each attachment control. Assuming you have controls named DataCardValue3_1, DataCardValue3_2, etc., you can use the following formula:

    ForAll(
     Concatenate(
     DataCardValue3_1.Attachments,
     DataCardValue3_2.Attachments,
     ... // Add more controls as needed
     ),
     'PowerAppV2->Createfile'.Run(
     {
     file: {
     contentBytes: Document.Value,
     name: Document.Name
     }
     }
     )
    )

    This formula concatenates the attachments from all specified controls into a single list and then uses ForAll to iterate through that list, running the 'PowerAppV2->Createfile' for each attachment.

    Give this a try, and it should help you upload files from multiple attachment controls with a single button press. 😊 Regards! Ali Shahzad

     

  • Pro_User_365 Profile Picture
    546 on at

    Hi  @Anonymous,

    To upload files from multiple attachment controls with one button press, you can modify your formula to iterate through each attachment control. Here's the adjusted formula:

    ForAll(
     Concatenate(
     DataCardValue3_1.Attachments,
     DataCardValue3_2.Attachments,
     ... // Add more controls as needed
     ),
     'PowerAppV2->Createfile'.Run(
     {
     file: {
     contentBytes: Document.Value,
     name: Document.Name
     }
     }
     )
    )

    This formula concatenates the attachments from all specified controls into a single list and then uses ForAll to iterate through that list, running the 'PowerAppV2->Createfile' for each attachment.

    Give this a try, and it should help you upload files from multiple attachment controls with a single button press. 😊 Regards! Ali Shahzad

  • Pstork1 Profile Picture
    69,665 Most Valuable Professional on at

    As I said in my reply, that will run the flow once for each attachment in the control.  That's fine if you want to run the flow multiple times. But if you want to upload the files as an array then you need to send them as json text and parse them again in the flow. Then you can access each file in that one flow run.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 342 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 271

#3
Mohsin Ali Profile Picture

Mohsin Ali 239

Last 30 days Overall leaderboard