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 / Powerapps forAll + PAT...
Power Apps
Unanswered

Powerapps forAll + PATCH function Very Slow

(0) ShareShare
ReportReport
Posted on by 150

Hello experts! 

i am really desperate for help here. (i cant sleep anymore thinking about this lol!) so here is my situation. i have created a canvas app for site visit form. im using a SP list as my data source for form template and another SP list for the results. Now, i created the form without using form control in powerapps because there are 122 questions and i didnt want to create 122 columns in SP list so i used Gallery instead. Long story short i have to section the questions so the user doesnt get overwhelmed with one big form so i ended up creating 15 different galleries. so far everything is working fine but its VERY SLOWWWW when i patch the 15 galleries ALL items (total of 122 questions) to sp list.

 

I have to patch all the items (all questions) in the gallery so that it would be on the SP list . The purpose of this is because the user may not be able to finish the form. User will save the draft and continue later. i have to patch all the question to the sp list so they can come back and answer the rest of the question or edit.

 

i saw this blog and tried to follow it https://www.matthewdevaney.com/patch-multiple-records-in-power-apps-10x-faster/ and this https://www.matthewdevaney.com/fastest-way-to-patch-all-gallery-items-power-apps/ but i cant figure out how to apply it on my patch function.

 

Please help!!

 

here is my function and i  repeated the code 15 times for each gallery, separating them function by ";"

 

 

 

ForAll(
 Gal_Staff.AllItems,
 Patch(
 'Site Visit Form Results',
 Defaults('Site Visit Form Results'),
 {
 SiteVisitDate: dp_SiteVisitDate_Info.SelectedDate,
 'Location': dd_Loc_Info.SelectedText.Value,
 'RDO/RGM': lbl_rdoRgm_Val.Text,
 PIC: lbl_Pic_Val.Text,
 Title: btn_title_Staffing.Text,
 Status: DD_Status.SelectedText,
 Sort: lbl_sort_Staff.Text,
 Questions: lbl_qstions_Staff.Text,
 Comment: txtInpt_forNo_Staff.Text,
 'Overall Comments': txtInpt_Answer_Staff.Text,
 Answers: LookUp(
 Split(
 "Yes;No;NA",
 ";"
 ),
 Value = radioYN_Staff.Selected.Value
 ),
 ColType: lbl_Coltyp_Staff.Text
 }
 )
);
ForAll(
 Gal_PSOS.AllItems,
 Patch(
 'Site Visit Form Results',
 Defaults('Site Visit Form Results'),
 {
 SiteVisitDate: dp_SiteVisitDate_Info.SelectedDate,
 'Location': dd_Loc_Info.SelectedText.Value,
 'RDO/RGM': lbl_rdoRgm_Val.Text,
 PIC: lbl_Pic_Val.Text,
 Status: DD_Status.SelectedText,
 Sort: lbl_sort_PSOS.Text,
 Title: btn_title_PSOS.Text,
 Questions: lbl_qstions_PSOS.Text,
 Comment: txtInpt_forNo_PSOS.Text,
 'Overall Comments': txtInpt_Answer_PSOS.Text,
 Answers: LookUp(
 Split(
 "Yes;No;NA",
 ";"
 ),
 Value = radioYN_PSOS.Selected.Value
 ),
 ColType: lbl_Coltyp_PSOS.Text
 }
 )
);
ForAll(
 Gal_Quality.AllItems,
 Patch(
 'Site Visit Form Results',
 Defaults('Site Visit Form Results'),
 {
 SiteVisitDate: dp_SiteVisitDate_Info.SelectedDate,
 'Location': dd_Loc_Info.SelectedText.Value,
 'RDO/RGM': lbl_rdoRgm_Val.Text,
 PIC: lbl_Pic_Val.Text,
 Status: DD_Status.SelectedText,
 Sort: lbl_sort_Quality.Text,
 Title: btn_title_Quality.Text,
 Questions: lbl_qstions_Quality.Text,
 Comment: txtInpt_forNo_Quality.Text,
 'Overall Comments': txtInpt_Answer_Quality.Text,
 Answers: LookUp(
 Split(
 "Yes;No;NA",
 ";"
 ),
 Value = radioYN_Quality.Selected.Value
 ),
 ColType: lbl_Coltyp_Quality.Text
 }
 )
);
ForAll(
 Gal_EE.AllItems,
 Patch(
 'Site Visit Form Results',
 Defaults('Site Visit Form Results'),
 {
 SiteVisitDate: dp_SiteVisitDate_Info.SelectedDate,
 'Location': dd_Loc_Info.SelectedText.Value,
 'RDO/RGM': lbl_rdoRgm_Val.Text,
 PIC: lbl_Pic_Val.Text,
 Status: DD_Status.SelectedText,
 Sort: lbl_sort_EE.Text,
 Title: btn_title_EE.Text,
 Questions: lbl_qstions_EE.Text,
 Comment: txtInpt_forNo_EE.Text,
 'Overall Comments': txtInpt_Answer_EE.Text,
 Answers: LookUp(
 Split(
 "Yes;No;NA",
 ";"
 ),
 Value = radioYN_EE.Selected.Value
 ),
 ColType: lbl_Coltyp_EE.Text
 }
 )
);
ForAll(
 Gal_Usp795.AllItems,
 Patch(
 'Site Visit Form Results',
 Defaults('Site Visit Form Results'),
 {
 SiteVisitDate: dp_SiteVisitDate_Info.SelectedDate,
 'Location': dd_Loc_Info.SelectedText.Value,
 'RDO/RGM': lbl_rdoRgm_Val.Text,
 PIC: lbl_Pic_Val.Text,
 Status: DD_Status.SelectedText,
 Sort: lbl_sort_Usp795.Text,
 Title: btn_title_795.Text,
 Questions: lbl_qstions_Usp795.Text,
 Comment: txtInpt_forNo_Usp795.Text,
 'Overall Comments': txtInpt_Answer_Usp795.Text,
 Answers: LookUp(
 Split(
 "Yes;No;NA",
 ";"
 ),
 Value = radioYN_Usp795.Selected.Value
 ),
 ColType: lbl_Coltyp_795.Text
 }
 )
);
ForAll(
 Gal_Usp797.AllItems,
 Patch(
 'Site Visit Form Results',
 Defaults('Site Visit Form Results'),
 {
 SiteVisitDate: dp_SiteVisitDate_Info.SelectedDate,
 'Location': dd_Loc_Info.SelectedText.Value,
 'RDO/RGM': lbl_rdoRgm_Val.Text,
 PIC: lbl_Pic_Val.Text,
 Status: DD_Status.SelectedText,
 Sort: lbl_sort_Usp797.Text,
 Title: btn_title_797.Text,
 Questions: lbl_qstions_Usp797.Text,
 Comment: txtInpt_forNo_Usp797.Text,
 'Overall Comments': txtInpt_Answer_Usp797.Text,
 Answers: LookUp(
 Split(
 "Yes;No;NA",
 ";"
 ),
 Value = radioYN_Usp797.Selected.Value
 ),
 ColType: lbl_Coltyp_Usp797.Text
 }
 )
);
ForAll(
 Gal_Narc.AllItems,
 Patch(
 'Site Visit Form Results',
 Defaults('Site Visit Form Results'),
 {
 SiteVisitDate: dp_SiteVisitDate_Info.SelectedDate,
 'Location': dd_Loc_Info.SelectedText.Value,
 'RDO/RGM': lbl_rdoRgm_Val.Text,
 PIC: lbl_Pic_Val.Text,
 Status: DD_Status.SelectedText,
 Sort: lbl_sort_Narc.Text,
 Title: btn_title_Narc.Text,
 Questions: lbl_qstions_Narc.Text,
 Comment: txtInpt_forNo_Narc.Text,
 'Overall Comments': txtInpt_Answer_Narc.Text,
 Answers: LookUp(
 Split(
 "Yes;No;NA",
 ";"
 ),
 Value = radioYN_Narc.Selected.Value
 ),
 ColType: lbl_Coltyp_Narc.Text
 }
 )
);
ForAll(
 Gal_Inv.AllItems,
 Patch(
 'Site Visit Form Results',
 Defaults('Site Visit Form Results'),
 {
 SiteVisitDate: dp_SiteVisitDate_Info.SelectedDate,
 'Location': dd_Loc_Info.SelectedText.Value,
 'RDO/RGM': lbl_rdoRgm_Val.Text,
 PIC: lbl_Pic_Val.Text,
 Status: DD_Status.SelectedText,
 Sort: lbl_sort_Inv.Text,
 Title: btn_title_Inv.Text,
 Questions: lbl_qstions_Inv.Text,
 Comment: txtInpt_forNo_Inv.Text,
 'Overall Comments': txtInpt_Answer_Inv.Text,
 Answers: LookUp(
 Split(
 "Yes;No;NA",
 ";"
 ),
 Value = radioYN_Inv.Selected.Value
 ),
 ColType: lbl_Coltyp_Inv.Text
 }
 )
);
ForAll(
 Gal_Prepk.AllItems,
 Patch(
 'Site Visit Form Results',
 Defaults('Site Visit Form Results'),
 {
 SiteVisitDate: dp_SiteVisitDate_Info.SelectedDate,
 'Location': dd_Loc_Info.SelectedText.Value,
 'RDO/RGM': lbl_rdoRgm_Val.Text,
 PIC: lbl_Pic_Val.Text,
 Status: DD_Status.SelectedText,
 Sort: lbl_sort_Prepk.Text,
 Title: btn_title_Prepk.Text,
 Questions: lbl_qstions_Prepk.Text,
 Comment: txtInpt_forNo_Prepk.Text,
 'Overall Comments': txtInpt_Answer_Prepk.Text,
 Answers: LookUp(
 Split(
 "Yes;No;NA",
 ";"
 ),
 Value = radioYN_Prepk.Selected.Value
 ),
 ColType: lbl_Coltyp_Prepk.Text
 }
 )
);
ForAll(
 Gal_AutoOp.AllItems,
 Patch(
 'Site Visit Form Results',
 Defaults('Site Visit Form Results'),
 {
 SiteVisitDate: dp_SiteVisitDate_Info.SelectedDate,
 'Location': dd_Loc_Info.SelectedText.Value,
 'RDO/RGM': lbl_rdoRgm_Val.Text,
 PIC: lbl_Pic_Val.Text,
 Status: DD_Status.SelectedText,
 Sort: lbl_sort_AutoOp.Text,
 Title: btn_title_AutoOp.Text,
 Questions: lbl_qstions_AutoOp.Text,
 Comment: txtInpt_forNo_AutoOp.Text & Concat(
 Filter(
 Gal_ChkBox_AutoOp.AllItems,
 Checkbox1.Value
 ),
 Checkbox1.Text,
 ";"
 ),
 'Overall Comments': txtInpt_Answer_AutoOp.Text,
 Answers: LookUp(
 Split(
 "Yes;No;NA",
 ";"
 ),
 Value = radioYN_AutoOp.Selected.Value
 ),
 ColType: lbl_Coltyp_AutoOp.Text
 }
 )
);
ForAll(
 Gal_Compliance.AllItems,
 Patch(
 'Site Visit Form Results',
 Defaults('Site Visit Form Results'),
 {
 SiteVisitDate: dp_SiteVisitDate_Info.SelectedDate,
 'Location': dd_Loc_Info.SelectedText.Value,
 'RDO/RGM': lbl_rdoRgm_Val.Text,
 PIC: lbl_Pic_Val.Text,
 Status: DD_Status.SelectedText,
 Sort: lbl_sort_Compliance.Text,
 Title: btn_title_Compliance.Text,
 Questions: lbl_qstions_Compliance.Text,
 Comment: txtInpt_forNo_Compliance.Text,
 'Overall Comments': txtInpt_Answer_Compliance.Text,
 Answers: LookUp(
 Split(
 "Yes;No;NA",
 ";"
 ),
 Value = radioYN_Compliance.Selected.Value
 ),
 ColType: lbl_Coltyp_Compliance.Text
 }
 )
);
ForAll(
 Gal_Ekit.AllItems,
 Patch(
 'Site Visit Form Results',
 Defaults('Site Visit Form Results'),
 {
 SiteVisitDate: dp_SiteVisitDate_Info.SelectedDate,
 'Location': dd_Loc_Info.SelectedText.Value,
 'RDO/RGM': lbl_rdoRgm_Val.Text,
 PIC: lbl_Pic_Val.Text,
 Status: DD_Status.SelectedText,
 Sort: lbl_sort_Ekit.Text,
 Title: btn_title_Ekit.Text,
 Questions: lbl_qstions_Ekit.Text,
 Comment: txtInpt_forNo_Ekit.Text & Concat(
 Filter(
 Gal_Chkbox_Ekit.AllItems,
 Checkbox2.Value
 ),
 Checkbox2.Text,
 ";"
 ),
 'Overall Comments': txtInpt_Answer_Ekit.Text,
 Answers: LookUp(
 Split(
 "Yes;No;NA",
 ";"
 ),
 Value = radioYN_Ekit.Selected.Value
 ),
 ColType: lbl_Coltyp_Ekit.Text
 }
 )
);
ForAll(
 Gal_Usp800.AllItems,
 Patch(
 'Site Visit Form Results',
 Defaults('Site Visit Form Results'),
 {
 SiteVisitDate: dp_SiteVisitDate_Info.SelectedDate,
 'Location': dd_Loc_Info.SelectedText.Value,
 'RDO/RGM': lbl_rdoRgm_Val.Text,
 PIC: lbl_Pic_Val.Text,
 Status: DD_Status.SelectedText,
 Sort: lbl_sort_Usp800.Text,
 Title: btn_title_Usp800.Text,
 Questions: lbl_qstions_Usp800.Text,
 Comment: txtInpt_forNo_Usp800.Text,
 'Overall Comments': txtInpt_Answer_Usp800.Text,
 Answers: LookUp(
 Split(
 "Yes;No;NA",
 ";"
 ),
 Value = radioYN_Usp800.Selected.Value
 ),
 ColType: lbl_Coltyp_Usp800.Text
 }
 )
);
ForAll(
 Gal_Returns.AllItems,
 Patch(
 'Site Visit Form Results',
 Defaults('Site Visit Form Results'),
 {
 SiteVisitDate: dp_SiteVisitDate_Info.SelectedDate,
 'Location': dd_Loc_Info.SelectedText.Value,
 'RDO/RGM': lbl_rdoRgm_Val.Text,
 PIC: lbl_Pic_Val.Text,
 Status: DD_Status.SelectedText,
 Sort: lbl_sort_Returns.Text,
 Title: btn_title_Returns.Text,
 Questions: lbl_qstions_Returns.Text,
 Comment: txtInpt_forNo_Returns.Text,
 'Overall Comments': txtInpt_Answer_Returns.Text,
 Answers: LookUp(
 Split(
 "Yes;No;NA",
 ";"
 ),
 Value = radioYN_Returns.Selected.Value
 ),
 ColType: lbl_Coltyp_Returns.Text
 }
 )
);
ForAll(
 Gal_RxTask.AllItems,
 Patch(
 'Site Visit Form Results',
 Defaults('Site Visit Form Results'),
 {
 SiteVisitDate: dp_SiteVisitDate_Info.SelectedDate,
 'Location': dd_Loc_Info.SelectedText.Value,
 'RDO/RGM': lbl_rdoRgm_Val.Text,
 PIC: lbl_Pic_Val.Text,
 Status: DD_Status.SelectedText,
 Sort: lbl_sort_Rxtask.Text,
 Title: btn_title_RxTask.Text,
 Questions: lbl_qstions_RxTask.Text,
 Comment: txtInpt_forNo_RxTask.Text,
 'Overall Comments': txtInpt_Answer_RxTask.Text,
 Answers: LookUp(
 Split(
 "Yes;No;NA",
 ";"
 ),
 Value = radioYN_RxTask.Selected.Value
 ),
 ColType: lbl_Coltyp_RxTask.Text
 }
 )
);
ForAll(
 Gal_PasMed.AllItems,
 Patch(
 'Site Visit Form Results',
 Defaults('Site Visit Form Results'),
 {
 SiteVisitDate: dp_SiteVisitDate_Info.SelectedDate,
 'Location': dd_Loc_Info.SelectedText.Value,
 'RDO/RGM': lbl_rdoRgm_Val.Text,
 PIC: lbl_Pic_Val.Text,
 Status: DD_Status.SelectedText,
 Sort: lbl_sort_PasMed.Text,
 Title: btn_title_PasMed.Text,
 Questions: lbl_qstions_PasMed.Text,
 Comment: txtInpt_forNo_PasMed.Text,
 'Overall Comments': txtInpt_Answer_PasMed.Text,
 Answers: LookUp(
 Split(
 "Yes;No;NA",
 ";"
 ),
 Value = radioYN_PasMed.Selected.Value
 ),
 ColType: lbl_Coltyp_PasMed.Text
 }
 )
);
ForAll(
 Gal_RvrseDist.AllItems,
 Patch(
 'Site Visit Form Results',
 Defaults('Site Visit Form Results'),
 {
 SiteVisitDate: dp_SiteVisitDate_Info.SelectedDate,
 'Location': dd_Loc_Info.SelectedText.Value,
 'RDO/RGM': lbl_rdoRgm_Val.Text,
 PIC: lbl_Pic_Val.Text,
 Status: DD_Status.SelectedText,
 Sort: lbl_sort_RvrseDist.Text,
 Title: btn_title_RvrseDist.Text,
 Questions: lbl_qstions_RvrseDist.Text,
 Comment: txtInpt_forNo_RvrseDist.Text,
 'Overall Comments': txtInpt_Answer_RvrseDist.Text,
 Answers: LookUp(
 Split(
 "Yes;No;NA",
 ";"
 ),
 Value = radioYN_RvrseDist.Selected.Value
 ),
 ColType: lbl_Coltyp_RvrseDist.Text
 }
 )
);
ForAll(
 Gal_HH.AllItems,
 Patch(
 'Site Visit Form Results',
 Defaults('Site Visit Form Results'),
 {
 SiteVisitDate: dp_SiteVisitDate_Info.SelectedDate,
 'Location': dd_Loc_Info.SelectedText.Value,
 'RDO/RGM': lbl_rdoRgm_Val.Text,
 PIC: lbl_Pic_Val.Text,
 Status: DD_Status.SelectedText,
 Sort: lbl_sort_HH.Text,
 Title: btn_title_HH.Text,
 Questions: lbl_qstions_HH.Text,
 Comment: txtInpt_forNo_HH.Text,
 'Overall Comments': txtInpt_Answer_HH.Text,
 Answers: LookUp(
 Split(
 "Yes;No;NA",
 ";"
 ),
 Value = radioYN_HH.Selected.Value
 ),
 ColType: lbl_Coltyp_HH.Text
 }
 )
);
ForAll(
 Gal_PsOrg.AllItems,
 Patch(
 'Site Visit Form Results',
 Defaults('Site Visit Form Results'),
 {
 SiteVisitDate: dp_SiteVisitDate_Info.SelectedDate,
 'Location': dd_Loc_Info.SelectedText.Value,
 'RDO/RGM': lbl_rdoRgm_Val.Text,
 PIC: lbl_Pic_Val.Text,
 Status: DD_Status.SelectedText,
 Sort: lbl_sort_PsOrg.Text,
 Title: btn_title_PsOrg.Text,
 Questions: lbl_qstions_PsOrg.Text,
 Comment: txtInpt_forNo_PsOrg.Text,
 'Overall Comments': txtInpt_Answer_PsOrg.Text,
 Answers: LookUp(
 Split(
 "Yes;No;NA",
 ";"
 ),
 Value = radioYN_PsOrg.Selected.Value
 ),
 ColType: lbl_Coltyp_PsOrg.Text
 }
 )
);
ForAll(
 Gal_NewBus.AllItems,
 Patch(
 'Site Visit Form Results',
 Defaults('Site Visit Form Results'),
 {
 SiteVisitDate: dp_SiteVisitDate_Info.SelectedDate,
 'Location': dd_Loc_Info.SelectedText.Value,
 'RDO/RGM': lbl_rdoRgm_Val.Text,
 PIC: lbl_Pic_Val.Text,
 Status: DD_Status.SelectedText,
 Sort: lbl_sort_NewBus.Text,
 Title: btn_title_NewBus.Text,
 Questions: lbl_qstions_NewBus.Text,
 Comment: txtInpt_forNo_NewBus.Text,
 'Overall Comments': txtInpt_Answer_NewBus.Text,
 Answers: LookUp(
 Split(
 "Yes;No;NA",
 ";"
 ),
 Value = radioYN_NewBus.Selected.Value
 ),
 ColType: lbl_Coltyp_NewBus.Text
 }
 )
);
ForAll(
 Gal_Conclusions.AllItems,
 Patch(
 'Site Visit Form Results',
 Defaults('Site Visit Form Results'),
 {
 SiteVisitDate: dp_SiteVisitDate_Info.SelectedDate,
 'Location': dd_Loc_Info.SelectedText.Value,
 'RDO/RGM': lbl_rdoRgm_Val.Text,
 PIC: lbl_Pic_Val.Text,
 Status: DD_Status.SelectedText,
 Sort: lbl_sort_Conclusions.Text,
 Title: btn_title_Conclusions.Text,
 Questions: lbl_qstions_Conclusions.Text,
 Comment: txtInpt_forNo_Conclusions.Text,
 'Overall Comments': txtInpt_Answer_Conclusions.Text,
 Answers: LookUp(
 Split(
 "Yes;No;NA",
 ";"
 ),
 Value = radioYN_Conclusions.Selected.Value
 ),
 ColType: lbl_Coltyp_Conclusions.Text
 }
 )
);
ForAll(
 Gal_RvwrNotes.AllItems,
 Patch(
 'Site Visit Form Results',
 Defaults('Site Visit Form Results'),
 {
 SiteVisitDate: dp_SiteVisitDate_Info.SelectedDate,
 'Location': dd_Loc_Info.SelectedText.Value,
 'RDO/RGM': lbl_rdoRgm_Val.Text,
 PIC: lbl_Pic_Val.Text,
 Status: DD_Status.SelectedText,
 Sort: lbl_sort_RvwrNotes.Text,
 Title: btn_title_RvwrNotes.Text,
 Questions: lbl_qstions_RvwrNotes.Text,
 'Overall Comments': txtInpt_Answer_RvwrNotes.Text,
 ColType: lbl_Coltyp_RvwrNotes.Text
 }
 )
);
Set(
 varReset,
 false
);
Set(
 varReset,
 true
);
Notify(
 "Your draft has been saved",
 NotificationType.Success
);
Navigate(Screen_Home)
//Set(varDropDownDefault,"Draft")

 

 

 

Categories:
I have the same question (0)
  • jrletner Profile Picture
    720 Moderator on at

    ForAll is really slow. Have you considered using Collections to store the records that actually need to be patched back to your SharePoint list? Then you could just do a straight Patch back to your datasource.

    Patch(datasource, collection) --> this would just patch the records you updated/collected directly back to your datasource.

    Collections documentation:
    Collect, Clear, and ClearCollect functions - Power Platform | Microsoft Learn

    Patch documentation:
    Patch function (contains video) - Power Platform | Microsoft Learn

  • abbyamante Profile Picture
    150 on at

    hello @jrletner ,

     

    Thank you.

     

    Yes i thought about using collections. just like what it says on the blog that i mentioned on my question. but i just dont know how to do it or where do i start? what property do i add the collection? on the blog, it says input a code on the onchange property but i need to patch items even without any changes. 

    Can you walk me through the steps please?

  • FishinKmac Profile Picture
    75 on at

    So the reason it is so slow is because you are Patching to the same list for each gallery (I am assuming) one after another which takes time because the next one wont run until the prior one is finished.

     

    Can you show me what the actual form looks like? I am a little confused by the galleries and the forAll's. You should be able to have a save draft button and submit the data and they can go back and finish at any time. 

  • enriqueglopez Profile Picture
    516 Moderator on at

    Maybe using Concurrent() and put inside the ForAll functions will increse speed a little bit, but there are a lot of ForAll functions.

     

    Let me know if my answer helped solving your issue.

    If it did please accept as solution and give it a thumbs up so we can help others in the community.

  • FishinKmac Profile Picture
    75 on at

    @enriqueglopez the problem with that is the they are all the same list... I dont know if that would cause an issue or not?

  • enriqueglopez Profile Picture
    516 Moderator on at

    Not really, as I can see, you are getting items from different galleries and uploading everything to a SharePoint list. Concurrent shouldn't cause you trouble.

     

    But, I think using a collection is a better approach

     

  • abbyamante Profile Picture
    150 on at

    Hello! here is what my form looks like:

    the gallery on the top are the sections of the form. onselect, i am hiding and showing the galleries for whatever is selected. 

     

    i have tried using one gallery but the users input does not stay when i tested out. for example on the first section of the form, the users selected radio buttons and input text on the text fields then selected the next section, when i went back to the first section all the selections and input was gone. so i created different galleries for each section then it works.

    abbyamante_1-1705610333084.png

     

     

  • abbyamante Profile Picture
    150 on at

    yes, collection is what im aiming for, but i need help

  • FishinKmac Profile Picture
    75 on at

    Is there a reason you are using a gallery instead of a form? 

    The ForAll is creating a new line item per gallery correct? Would you not want all of your answers in one line item? or is there a Parent/Child list? Just trying to understand the functionality before I can give a correct answer. 

     

    We have a couple apps here that are store assessments or inspections and there is one line item for all of the answers. My coworker built it using a Patch function and a collection but it ended up being much faster to submit the form itself and have the associate go back in to the edit form if they needed to continue or change something. 

     

  • enriqueglopez Profile Picture
    516 Moderator on at

    If every gallery has the same metadata structure, try to use

     

    Collect(MyCollection, Gallery1.AllItems);
    
    Collect(MyCollection, Gallery2.AllItems);
    
    ...

     

    And then

    ForAll(MyCollection, Patch(SharePointList, Defaults(SharePointList),{Your structure})

     

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 638

#2
Haque Profile Picture

Haque 317

#3
WarrenBelz Profile Picture

WarrenBelz 315 Most Valuable Professional

Last 30 days Overall leaderboard