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 / Patch multiple attachm...
Power Apps
Unanswered

Patch multiple attachments into Sharepoint list

(0) ShareShare
ReportReport
Posted on by 301
I have a Sharepoint list with enable attachment , and using Canvas App for creating records and uploading attachments into it.
depending on different approval stage/status, user can approve attachments .
Addition for every creation/modification to the list there is approval flow running , so I can't use two patch function to modify same record.
This below patch function is not working as required.
Basically I want to patch couple of field values like , Status(choice column),NameofBank(choice),Comment(multiline htmltext) and upload multiple attachments into same record
Patch
(
            RequestForIssueBG,
            varRecord,
            {
                Status: {Value:"Issued"},
                NameoftheBank: {Value: DataCardValue16.Selected.Value},
                GuaranteeNo: DataCardValue13.Text,
                ExpiryDate: DataCardValue14.SelectedDate,
                Whetherextendedearlier: {Value: DataCardValue15.Selected.Value},
                ApprovalComments: varRecord.ApprovalComments & "<br>" & varRecord.Status.Value & " Remark : " & Remarktxt.Text,
                ApprovalLogs: varRecord.ApprovalLogs & "<br>" & varRecord.Status.Value & ": BG issued on " & Text(
                    Now(),
                    "dd-mm-yy hh:mm"
                ) & " by " & Office365Users.UserProfileV2(User().Email).displayName & "; " & "Comment : " & Substitute(
                    Remarktxt.Text,
                    ".",
                    ""
                ),
                //& "<br>" & varLastSubmit.ApprovalLogs,
                RequestStatus: {Value: "Approved"}
            }//,BankGuaranteeform.Updates //add attachment here
        );Patch(RequestForIssueBG,varRecord,{},BankGuaranteeform.Updates)

Also I tried
Patch(
            RequestForIssueBG,
            varRecord,
            {
                Status: {Value:"Issued"},
                NameoftheBank: {Value: DataCardValue16.Selected.Value},
                GuaranteeNo: DataCardValue13.Text,
                ExpiryDate: DataCardValue14.SelectedDate,
                Whetherextendedearlier: {Value: DataCardValue15.Selected.Value},
                ApprovalComments: varRecord.ApprovalComments & "<br>" & varRecord.Status.Value & " Remark : " & Remarktxt.Text,
                ApprovalLogs: varRecord.ApprovalLogs & "<br>" & varRecord.Status.Value & ": BG issued on " & Text(
                    Now(),
                    "dd-mm-yy hh:mm"
                ) & " by " & Office365Users.UserProfileV2(User().Email).displayName & "; " & "Comment : " & Substitute(
                    Remarktxt.Text,
                    ".",
                    ""
                ),
                //& "<br>" & varLastSubmit.ApprovalLogs,
                RequestStatus: {Value: "Approved"}
            },BankGuaranteeform.Updates)
But this patch function doesn't update Choice field and multi line html text field 

Expert please help me with it.
Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    153,084 Most Valuable Professional on at

    Hi @apeawakening ,

    I cannot see a lot wrong with that code - which field names are not updating and is the rest working ? You can try this in the meantime

    Patch(
     RequestForIssueBG,
     {
     ID: varRecord.ID,
     Status: {Value: "Issued"},
     NameoftheBank: {Value: DataCardValue16.Selected.Value},
     GuaranteeNo: DataCardValue13.Text,
     ExpiryDate: DataCardValue14.SelectedDate,
     Whetherextendedearlier: {Value: DataCardValue15.Selected.Value},
     ApprovalComments: varRecord.ApprovalComments & "<br>" & varRecord.Status.Value & " Remark : " & Remarktxt.Text,
     ApprovalLogs: 
     varRecord.ApprovalLogs & "<br>" & varRecord.Status.Value & ": BG issued on " & 
     Text(
     Now(),
     "dd-mm-yy hh:mm"
     ) & " by " & User().FullName & "; " & 
     "Comment : " & 
     Substitute(
     Remarktxt.Text,
     ".",
     ""
     ),
     RequestStatus: {Value: "Approved"}
     },
     BankGuaranteeform.Updates
    )

    Also can you please set out the field types on each item

     

    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

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 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard