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 / Storing multiple File ...
Power Apps
Unanswered

Storing multiple File attachment in Dataverse table using Power Automate flow

(0) ShareShare
ReportReport
Posted on by

Hello,

The flow I would like to use is as follows.

Firstly, I would like to add each file attachment submitted, to the a collection and gather for a while.

Then, all the file attachments in the collection will be passed to the power automate flow by using ForAll in order to store in certain Dataverse table.

 

Thus, could you please help me with saving the file attachment to the collection ? Still, I do not have idea how to use the formula.

 

The sample scenario is as follows.

 

Thinzar_0-1719289330240.png

If(
    IsBlank(combo_budgetCodeRH_1.Selected.BudgetCodeID)  || IsBlank(txt_MaterialPA.Text)  || IsBlank(txt_FileattachPA.Text)  || IsBlank(txt_PurposeRH_1.Text) || IsBlank(txt_ReqAmountRH_1.Text),
    Notify(
        "Please fill all the required inputs",
        NotificationType.Warning
    ),
    Collect(
        RentHallGal,
        {
            Location: txt_MaterialPA.Text,
            TotalDays: txt_FileattachPA.Text,
            Purpose: txt_PurposeRH_1.Text,
            ReqAmount: txt_ReqAmountRH_1.Text,
            BudgetCode: combo_budgetCodeRH_1.Selected.BudgetCodeID
        }
    )
)
This is the screen I am creating
Thinzar_0-1719290121099.png

Multiple inputs will be used, in addition to the file upload.

Thus, form could not be used.

 

PS. The code is just adding data to the collection and does not include for adding file attachments. I would like to know how to modify the code and the new code for adding file attachments.
Thank you.
Categories:
I have the same question (0)
  • v-yueyun-msft Profile Picture
    on at

    Hi , @Thinzar 

    Can you try to use this expression in your Attachment control for three fields:

    ClearCollect(colAttaches,Self.Attachments)
     
    vyueyunmsft_0-1719366209909.png

     

     

    Best Regards,

    Yueyun Zhang

  • Thinzar Profile Picture
    on at

    Hello, @v-yueyun-msft ,

    Thanks with your suggestion.

    I have inserted the formula you have provided.

    What I would like to prepare is as follows.

    I would like to collect the file in a certain collection separately with its file attachment and its name.

    Then, the collected multiple files from the collection are to be passed to a certain power automate flow. To do so, I have found out that the file needs to be in acceptable format like JSON. So before passing the files, I would like to change its format into JSON also.

     

    Could you please give me some idea of this. I have provided with the formula and screenshot also.

     

    Collect(
    fileUploadCol,
    {
    FileName: {file:{contentBytes:Last(fileQuotation.Attachments).Name}},
    FileAttachment: {file:{contentBytes:Last(fileQuotation.Attachments).Value}}
    }
    )

     

    Thinzar_1-1719370947735.png

    The added file appears as table in the collection as follows

    Thinzar_0-1719372003701.png

     

     

  • v-yueyun-msft Profile Picture
    on at

    Hi , @Thinzar 

    Thanks for your response! Do you mean you want to get the Table like this:

    vyueyunmsft_0-1719380963939.png

    If this , you can try to use this expression:

    Collect(fileUploadCol,ForAll(  FileUpload.Attachments  ,{contentBytes:Value ,name:Name})  )
     

    If I misunderstand what you mean, you can describe your needs and your expected outcomes in detail so that we can better help you. If this reply can help you , you can click mark this reply as solution (Accept solution) which can help more people, thanks in advance! 

     

    Best Regards,

    Yueyun Zhang

  • Thinzar Profile Picture
    on at

    Thanks for your reply, @v-yueyun-msft 

     

    Whether table or not, I would like to collect the uploaded file from users in somewhere like collection, and then converted to the JSON format so that I could further proceed in transferring those files to the power automate flows, in order to store them in Dataverse table.

  • v-yueyun-msft Profile Picture
    on at

    Hi , @Thinzar 

    Thanks for your response! Do you mean you want to convert your collection to Json Onject.

    If this you can try to use this expression:

    Set(jsondata , JSON(fileUploadCol , JSONFormat.IncludeBinaryData) )
     

    Best Regards,

    Yueyun Zhang

     

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…

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
Kalathiya Profile Picture

Kalathiya 321 Super User 2026 Season 1

#2
WarrenBelz Profile Picture

WarrenBelz 289 Most Valuable Professional

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 200 Super User 2026 Season 1

Last 30 days Overall leaderboard