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 multiple gallery...
Power Apps
Answered

patch multiple gallery repeating table together with form

(0) ShareShare
ReportReport
Posted on by 418

Hi, on my screen page i have create a form with 2 gallery for repeating table and store it to collection before final submit.. it is possible to patch this OnScreen (Form) using this formula? or any other way to combine together?

 

Because not error occur but this patch not save data to sharepoint list..only save the Form data

 

ForAll(
 colApp,
 If(
 !IsBlank(invoiceno),
 If(
 CountRows(colApp) > 0,
 Patch(
 sinc_main_payment,
 Defaults(sinc_main_payment),
 {
 Title: Form1.LastSubmit.ID,
 app_no: Form1.LastSubmit.Title,
 invoice_no: invoiceno,
 invoice_date: DateValue(invoicedate),
 invoice_amount: invoiceamount
 }
 )
 )
 )
);
ForAll(
 colTeam,
 If(
 !IsBlank(staffname),
 If(
 CountRows(colTeam) > 0,
 Patch(
 sinc_main_team,
 Defaults(sinc_main_team),
 {
 Title: Form1.LastSubmit.ID,
 app_no: Form1.LastSubmit.Title,
 name: staffname,
 department: departmentname,
 percentage: percent
 }
 )
 )
 )
);
Clear(colApp);
Clear(colTeam);

 

 

Categories:
  • Verified answer
    WarrenBelz Profile Picture
    156,532 Most Valuable Professional on at

    Hi @twister ,

    Two things possibly - firstly, put the CountRows() test at the start. Also is your invoicedate already a date field in the collection?

    If(
     CountRows(colApp) > 0,
     ForAll(
     colApp,
     If(
     !IsBlank(invoiceno),
     Patch(
     sinc_main_payment,
     Defaults(sinc_main_payment),
     {
     Title: Form1.LastSubmit.ID,
     app_no: Form1.LastSubmit.Title,
     invoice_no: invoiceno,
     invoice_date: invoicedate,
     invoice_amount: invoiceamount
     }
     )
     )
     )
    );
    If(
     CountRows(colTeam) > 0,
     ForAll(
     colTeam,
     If(
     !IsBlank(staffname),
     Patch(
     sinc_main_team,
     Defaults(sinc_main_team),
     {
     Title: Form1.LastSubmit.ID,
     app_no: Form1.LastSubmit.Title,
     name: staffname,
     department: departmentname,
     percentage: percent
     }
     )
     )
     )
    );
    Clear(colApp);
    Clear(colTeam);

     

    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.

  • twister Profile Picture
    418 on at

    yes, invoicedate already in collection because if im using 1 gallery(1 repeating table = colApp) only the patch function working well.  The issue happen after i tried to combine 2 gallery (add colTeam).. I can't see any error but the patch data not save in sharepoint..

     

    i also try to used your formula but the result are same.. still looking where is my mistake..

    twister_1-1613442199995.png

     

     

    twister_0-1613442174826.png

     

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

    @twister ,

    You are trying to write a numeric field (ID) into a Text Field (Title) try

    Title: Text(Form1.LastSubmit.ID)

    I can only guess here as I cannot see your data structure.

     

    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.

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

    Hi @twister ,

    Just checking if you got the result you were looking for on this thread. Happy to help further if not.

    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.

  • twister Profile Picture
    418 on at

    yes.. consider success after i recheck & redo the formula, also due to I have missed up my formula.. thanks @WarrenBelz 

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
11manish Profile Picture

11manish 411 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 338

#3
WarrenBelz Profile Picture

WarrenBelz 256 Most Valuable Professional

Last 30 days Overall leaderboard