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 / Patch Attachment for e...
Power Apps
Answered

Patch Attachment for each checklisted items

(3) ShareShare
ReportReport
Posted on by 20
I want to create similar entries with same attachments for each checklist items that i have selected. But I have trouble in patching the attachment. It seems that I have trouble in the Attachment syntax.
 
 
 
I have followed the solution through this post:
Solved: Patch Attachments to Sharepoint List
 
Can I ask for help in debugging this issue? What part and syntax is wrong in my case? Thank you.
Screenshot_17-7-2025_142251_make.powerapps.com.jpeg
Screenshot_17-7-2025_14282_make.powerapps.com.jpeg
Categories:
I have the same question (0)
  • mmbr1606 Profile Picture
    14,629 Super User 2026 Season 1 on at
    hey
     
     
     
    can you please copy paste your code here using the code snippet tool here.

    In this case we do not need to retype the code and can help faster,
     
     
    thanks
  • Sri Kurnia Profile Picture
    20 on at
    This is the code. I apologize to not include this:
     
    ForAll(
        col_SelectedCompanies,
        Patch('Relation PT-Compliance',Defaults('Relation PT-Compliance'),
            {
                IDCompliance: gallery_PT_1.Selected.ID,
                IDPT: ThisRecord.ID,
                'Periode Bulan': Month(Today()),
                'Periode Tahun': Year(Today()),
                Attachments:Table(
                    {
                        DisplayName: First(DataCardValue5_3.LastSubmit.Attachments).Name,
                        AbsoluteUri: Blank(),
                        Id: First(DataCardValue5_3.LastSubmit.Attachments),
                        Value: First(DataCardValue5_3.LastSubmit.Attachments).Value
                    }
                )
            }
        )
    );
  • Verified answer
    stampcoin Profile Picture
    5,158 Super User 2026 Season 1 on at
    if your attachment is with a form (only with attachment control), consider separate the code.
     
    ForAll(
        col_SelectedCompanies,
        Patch('Relation PT-Compliance',Defaults('Relation PT-Compliance'),
            {
                IDCompliance: gallery_PT_1.Selected.ID,
                 ..
                
            },
         YourForm.Updates // this will upload the attachment without extra code.
        )
    );
  • Sri Kurnia Profile Picture
    20 on at
    @stampcoin
    Thank you for your help. I can finally create many entries based on the selected items and also each with the respective attachments. 

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 860

#2
Valantis Profile Picture

Valantis 548

#3
Haque Profile Picture

Haque 417

Last 30 days Overall leaderboard