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 / Adding Attachment to M...
Power Apps
Suggested Answer

Adding Attachment to Multiple Records on Same Table Simultaneously

(0) ShareShare
ReportReport
Posted on by 257

I'm pretty sure I know the answer, but I'm trying desperately to think outside of the box and maybe find a backdoor way to do this.

 

I have a screen using individual controls (Not in an EditForm) that patches data to new records all at one time for my Purchasing department to enter cost changes from one supplier on multiple items at once. They want to be able to add the quote file for all of those items at one time. 

MechEng2013_0-1706302347799.png

 

Everything works as it should and now they want the attachment functionality. I am finding that patching attachments is "Not Possible", that the datatype returns as "Table". Surely there is a way to add an attachment to a record's attachments field outside of a form? 

If not, is there something creative I can do by adding a form on this page that follows up the patch function with an update to that record? Can I store the attachment temporarily in a collection or another attachment box perhaps in order to facilitate this?
Any thoughts or comments welcomed!
Thanks

Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    156,384 Most Valuable Professional on at

    Hi @MechEng2013 ,

    It can be done with Power Automate - you can get the ID of the new record - it would look something like this

    UpdateContext(
     {
     varID:
     Patch(
     YourPatchHere
     ).ID
     }
    );
    YourFlowName.Run(
     varID,
     {
     file:
     {
     contentBytes: Last(AttachmentControlName.Attachments).Value,
     name: Last(AttachmentControlName.Attachments).name
     }
     }
    )

     

    WarrenBelz_1-1706304160624.png

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    MVP (Business Applications)   Visit my blog Practical Power Apps

  • MechEng2013 Profile Picture
    257 on at

    @WarrenBelz  thanks for the reply!

     

    Here is what I have so far:

     

    UpdateContext(
    {
    varID:
    Patch('Cost Changes',
    Defaults('Cost Changes'),
    {
    Article: DataCardValue319_17.Selected,
    }
    ).'Cost Change'
    }
    );
    CostChangeMultiAttach.Run( // flow to attach file to multiple records
    Value(varID),
    {
    file:
    {
    contentBytes: Last(CostMultiAttach.Attachments).Value,
    name: Last(CostMultiAttach.Attachments).Name
    }
    }
    );  

    MechEng2013_1-1706631662056.png

     

    MechEng2013_0-1706631641644.png

     

     

     

     I'm in Dataverse, and I think you're code was for Sharepoint, so for the flow run command it was expecting a number value and returning a GUID, so I added Value() function there.

     

    I'm getting no errors now, but the flow did not run at all. Checking Run History shows no runs.

     

    I did verify that varID is getting populated in the updatecontext function, 

     

    Is there anything else I can share?
    Thank you!!!!

     

  • WarrenBelz Profile Picture
    156,384 Most Valuable Professional on at

    Hi @MechEng2013 ,

    Always a good idea to state your data source in your initial post - I mistakenly assumed SharePoint. I do not use Dataverse (I am SharePoint only), so am not the best person to help you. I will tag my colleague @timl to see if he can assist.

  • Suggested answer
    Mehmet_Powerapps Profile Picture
    26 on at
    i think, i solved your problem. In my solution i have a combobox to select the records (here i select the records by title). 
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     

    The formula i wrote in the OnSelect property of the Update button is as follows

    ForAll(
        ComboboxTitel.SelectedItems,
        Patch(
            MySharePointList,
            {
                Titel: ThisRecord.Value
                // This part is optional. If there are any areas we want to update, we can add them here. 
                // I added the Titel field as an example. 
                
            }
        );
        Patch(
            MySharePointList,
            LookUp(MySharePointList,Titel=ThisRecord.Value),
            Form1.Updates
        )
    )
     
    Tip of the solution is that "We write two times patch function in the Forall". 
    You can find the more details about my solution at my Meidum account. Just search this term on google. 
    "Save a file as an attachment for multiple records in Power Apps".  
     
     

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

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 401 Most Valuable Professional

#2
11manish Profile Picture

11manish 201 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 128 Super User 2026 Season 2

Last 30 days Overall leaderboard