cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
abbyamante
Helper II
Helper II

Powerapps forAll + PATCH function Very Slow

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")

 

 

 

18 REPLIES 18

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})

 

abbyamante
Helper II
Helper II

@FishinKmac 

i didnt use the form because each individual questions would have to be individual columns in the sharepoint list. 

i tried doing it though (i created 122 columns in sp) with the form control but the app loads very slow. its about 6mins before it fully load. 

 

i have 2 sp list. one for question template and one for saving the results.

 

i need to patch each questions and answer results as individual row in sp list. like this:

 

abbyamante_0-1705613926412.png

 

@enriqueglopez - yes, all the galleries has the same structure. on what property do i put the collect?

OKay next question ... (sorry for all of the questions)  For each gallery are you adding new line items in the form? From what i can tell you are just answering single questions with some conditions. 

 

I still dont think you need a gallery, maybe a container and some controls on the screen but not a gallery. If you aren't adding new line items the for all is really only looking at one items and multiple controls for the one item. 

 

If that is the case i would have restructure as I suggested above and then have a next button that is present on each screen with a code similar to this 

Next Button OnSelect

Switch(varSection, 
"Staffing", 
Collect(colSiteVisit, 
{
            LineVisitDate: dp_SiteVisitDate_Info.SelectedDate,
            LineLocation: dd_Loc_Info.SelectedText.Value,
            LineRDORGM: lbl_rdoRgm_Val.Text,
            LinePIC: lbl_Pic_Val.Text,
            LineTitle: btn_title_Staffing.Text,
            LineStatus: DD_Status.SelectedText,
            LineSort: lbl_sort_Staff.Text,
            LineQuestions: lbl_qstions_Staff.Text,
            LineComments: txtInpt_forNo_Staff.Text,
            LineOverallComments: txtInpt_Answer_Staff.Text,
            LineAnswers: radioYN_Staff.Selected.Value,
            LineColType: lbl_Coltyp_Staff.Text
        })
, 
"PSOS", 
Collect(colSiteVisit
 {
            LineVisitDate: dp_SiteVisitDate_Info.SelectedDate,
            LineLocation: dd_Loc_Info.SelectedText.Value,
            LineRDORGM: lbl_rdoRgm_Val.Text,
            LinePTC: lbl_Pic_Val.Text,
            LineStatus: DD_Status.SelectedText,
            LineSort: lbl_sort_PSOS.Text,
            LineTitle: btn_title_PSOS.Text,
            LineQuestions: lbl_qstions_PSOS.Text,
            LineComments: txtInpt_forNo_PSOS.Text,
            LineOverallComments: txtInpt_Answer_PSOS.Text,
            LineAnswers: LradioYN_PSOS.Selected.Value,            ),
            LineColType: lbl_Coltyp_PSOS.Text
        }))

 

Then you can have a Save Button that Patches

ForAll(
    colSiteVisit,
    Patch(
        'Site Visit Form Results',
        Defaults('Site Visit Form Results'),
        {
            SiteVisitDate: LineVisitDate.SelectedDate,
           'Location': LineLocation.Value,
            'RDO/RGM': LineRDORGM.Text,
            PIC: LinePIC.Text,
            Status: LineStatus.Text,
            Sort: LineSort.Text,
            Title: LineTitle.Text,
            Questions: LineQuestion.Text,
            'Overall Comments': LineOverallComment.Text,
            Answers: LineAnswer.Value
            ColType: LineColeTyle.Text

        }
    )
)

 

Something along these lines

@abbyamante , looking at that form, I honestly think the best solution might be to patch as you go...meaning, every time the user updates a question, go ahead and patch that record back. This would avoid the ForAlls and the need for a collection.


To do that, you can add this to the OnChange for the radio button control.

Patch(datasource,thisrecord)

@jrletner i agree. i just need to figure out how to send the data to collections even though the user did not made an update.

@abbyamante ,

 

I have built an example of what I'm suggesting. I have a datasource and a radio button control. As soon as I click an option on the radio button, it immediately patches the datasource with the new value. 

This prevents a ForAll or a Collection from having to handle the patch.


In this example, the value on the left corresponds with the option selected in the radio button. As soon as the radio button is changed, the record is immediately patched back to the datasource and the value on the left updates (because it's pointing to that field in the datasource). Is this what you're trying to do?

 

jrletner_1-1705630864627.png


Now they change:

jrletner_2-1705630893220.png


I put this code in the OnChange property of the radio button control:

jrletner_3-1705630926360.png

 

 

@jrletner yes i tried this. and it does work. but it only works if i made a change on the radio button. i need to patch all items in the gallery even though there is NO change in the item. here is the reason for this.

 

the form has 122 questions. i sectioned the questions into 15 galleries. (i divided the 122 questions to 15 galleries). when the user creates a new form normally they only finish 2 sections of the form. I need to create a function that will allow the user to save and continue later. So what i did is even though the user did made a change or update on the rest of the sections of the form. i patch all the items (the items are basically the questions) in the sharepoint. then i created another gallery so the user can continue to fill out the rest of the sections of the form. 

 

your suggestion above is absolutely working and it patch to the sharepoint list. but its missing the rest of the questions. So when the user comes back they wont be able to fill out the rest of the form because the rest of the question is missing

jrletner
Responsive Resident
Responsive Resident

@abbyamante I understand now. So, yes, a collection is the way to go. 

 

The easiest way to do this is in the OnStart property of your App:

 

ClearCollect(myCollection, myDataSource)  <--- this creates a collection from the datasource

 

Then, have your gallery point to the Collection.

 

Then, OnChange of the Radio Button Control:   

 

Patch(myCollection, ThisItem)  <--- as the user makes changes, the collection is patched with the updates.

 

When the user is done: 

 

Patch(myDataSource, myCollection)  <--- this will patch all records from the collection back to the datasource in one mass update (instead of a ForAll).

Helpful resources

Announcements

Calling all User Group Leaders and Super Users! Mark Your Calendars for the next Community Ambassador Call on May 9th!

This month's Community Ambassador call is on May 9th at 9a & 3p PDT. Please keep an eye out in your private messages and Teams channels for your invitation. There are lots of exciting updates coming to the Community, and we have some exclusive opportunities to share with you! As always, we'll also review regular updates for User Groups, Super Users, and share general information about what's going on in the Community.     Be sure to register & we hope to see all of you there!

April 2024 Community Newsletter

We're pleased to share the April Community Newsletter, where we highlight the latest news, product releases, upcoming events, and the amazing work of our outstanding Community members.   If you're new to the Community, please make sure to follow the latest News & Announcements and check out the Community on LinkedIn as well! It's the best way to stay up-to-date with all the news from across Microsoft Power Platform and beyond.    COMMUNITY HIGHLIGHTS   Check out the most active community members of the last month! These hardworking members are posting regularly, answering questions, kudos, and providing top solutions in their communities. We are so thankful for each of you--keep up the great work! If you hope to see your name here next month, follow these awesome community members to see what they do!   Power AppsPower AutomateCopilot StudioPower PagesWarrenBelzDeenujialexander2523ragavanrajanLaurensMManishSolankiMattJimisonLucas001AmikcapuanodanilostephenrobertOliverRodriguestimlAndrewJManikandanSFubarmmbr1606VishnuReddy1997theMacResolutionsVishalJhaveriVictorIvanidzejsrandhawahagrua33ikExpiscornovusFGuerrero1PowerAddictgulshankhuranaANBExpiscornovusprathyooSpongYeNived_Nambiardeeksha15795apangelesGochixgrantjenkinsvasu24Mfon   LATEST NEWS Business Applications Launch Event - On Demand In case you missed the Business Applications Launch Event, you can now catch up on all the announcements and watch the entire event on-demand inside Charles Lamanna's latest cloud blog.   This is your one stop shop for all the latest Copilot features across Power Platform and #Dynamics365, including first-hand looks at how companies such as Lenovo, Sonepar, Ford Motor Company, Omnicom and more are using these new capabilities in transformative ways. Click the image below to watch today!     Power Platform Community Conference 2024 is here! It's time to look forward to the next installment of the Power Platform Community Conference, which takes place this year on 18-20th September 2024 at the MGM Grand in Las Vegas!   Come and be inspired by Microsoft senior thought leaders and the engineers behind the #PowerPlatform, with Charles Lamanna, Sangya Singh, Ryan Cunningham, Kim Manis, Nirav Shah, Omar Aftab and Leon Welicki already confirmed to speak. You'll also be able to learn from industry experts and Microsoft MVPs who are dedicated to bridging the gap between humanity and technology. These include the likes of Lisa Crosbie, Victor Dantas, Kristine Kolodziejski, David Yack, Daniel Christian, Miguel Félix, and Mats Necker, with many more to be announced over the coming weeks.   Click here to watch our brand-new sizzle reel for #PPCC24 or click the image below to find out more about registration. See you in Vegas!     Power Up Program Announces New Video-Based Learning Hear from Principal Program Manager, Dimpi Gandhi, to discover the latest enhancements to the Microsoft #PowerUpProgram. These include a new accelerated video-based curriculum crafted with the expertise of Microsoft MVPs, Rory Neary and Charlie Phipps-Bennett. If you’d like to hear what’s coming next, click the image below to find out more!     UPCOMING EVENTS Microsoft Build - Seattle and Online - 21-23rd May 2024 Taking place on 21-23rd May 2024 both online and in Seattle, this is the perfect event to learn more about low code development, creating copilots, cloud platforms, and so much more to help you unleash the power of AI.   There's a serious wealth of talent speaking across the three days, including the likes of Satya Nadella, Amanda K. Silver, Scott Guthrie, Sarah Bird, Charles Lamanna, Miti J., Kevin Scott, Asha Sharma, Rajesh Jha, Arun Ulag, Clay Wesener, and many more.   And don't worry if you can't make it to Seattle, the event will be online and totally free to join. Click the image below to register for #MSBuild today!     European Collab Summit - Germany - 14-16th May 2024 The clock is counting down to the amazing European Collaboration Summit, which takes place in Germany May 14-16, 2024. #CollabSummit2024 is designed to provide cutting-edge insights and best practices into Power Platform, Microsoft 365, Teams, Viva, and so much more. There's a whole host of experts speakers across the three-day event, including the likes of Vesa Juvonen, Laurie Pottmeyer, Dan Holme, Mark Kashman, Dona Sarkar, Gavin Barron, Emily Mancini, Martina Grom, Ahmad Najjar, Liz Sundet, Nikki Chapple, Sara Fennah, Seb Matthews, Tobias Martin, Zoe Wilson, Fabian Williams, and many more.   Click the image below to find out more about #ECS2024 and register today!   Microsoft 365 & Power Platform Conference - Seattle - 3-7th June If you're looking to turbo boost your Power Platform skills this year, why not take a look at everything TechCon365 has to offer at the Seattle Convention Center on June 3-7, 2024.   This amazing 3-day conference (with 2 optional days of workshops) offers over 130 sessions across multiple tracks, alongside 25 workshops presented by Power Platform, Microsoft 365, Microsoft Teams, Viva, Azure, Copilot and AI experts. There's a great array of speakers, including the likes of Nirav Shah, Naomi Moneypenny, Jason Himmelstein, Heather Cook, Karuana Gatimu, Mark Kashman, Michelle Gilbert, Taiki Y., Kristi K., Nate Chamberlain, Julie Koesmarno, Daniel Glenn, Sarah Haase, Marc Windle, Amit Vasu, Joanne C Klein, Agnes Molnar, and many more.   Click the image below for more #Techcon365 intel and register today!   For more events, click the image below to visit the Microsoft Community Days website.    

Tuesday Tip | Update Your Community Profile Today!

It's time for another TUESDAY TIPS, your weekly connection with the most insightful tips and tricks that empower both newcomers and veterans in the Power Platform Community! Every Tuesday, we bring you a curated selection of the finest advice, distilled from the resources and tools in the Community. Whether you’re a seasoned member or just getting started, Tuesday Tips are the perfect compass guiding you across the dynamic landscape of the Power Platform Community.   We're excited to announce that updating your community profile has never been easier! Keeping your profile up to date is essential for staying connected and engaged with the community.   Check out the following Support Articles with these topics: Accessing Your Community ProfileRetrieving Your Profile URLUpdating Your Community Profile Time ZoneChanging Your Community Profile Picture (Avatar)Setting Your Date Display Preferences Click on your community link for more information: Power Apps, Power Automate, Power Pages, Copilot Studio   Thank you for being an active part of our community. Your contributions make a difference! Best Regards, The Community Management Team

Hear what's next for the Power Up Program

Hear from Principal Program Manager, Dimpi Gandhi, to discover the latest enhancements to the Microsoft #PowerUpProgram, including a new accelerated video-based curriculum crafted with the expertise of Microsoft MVPs, Rory Neary and Charlie Phipps-Bennett. If you’d like to hear what’s coming next, click the link below to sign up today! https://aka.ms/PowerUp  

Tuesday Tip: Community User Groups

It's time for another TUESDAY TIPS, your weekly connection with the most insightful tips and tricks that empower both newcomers and veterans in the Power Platform Community! Every Tuesday, we bring you a curated selection of the finest advice, distilled from the resources and tools in the Community. Whether you’re a seasoned member or just getting started, Tuesday Tips are the perfect compass guiding you across the dynamic landscape of the Power Platform Community.   As our community family expands each week, we revisit our essential tools, tips, and tricks to ensure you’re well-versed in the community’s pulse. Keep an eye on the News & Announcements for your weekly Tuesday Tips—you never know what you may learn!   Today's Tip: Community User Groups and YOU Being part of, starting, or leading a User Group can have many great benefits for our community members who want to learn, share, and connect with others who are interested in the Microsoft Power Platform and the low-code revolution.   When you are part of a User Group, you discover amazing connections, learn incredible things, and build your skills. Some User Groups work in the virtual space, but many meet in physical locations, meaning you have several options when it comes to building community with people who are learning and growing together!   Some of the benefits of our Community User Groups are: Network with like-minded peers and product experts, and get in front of potential employers and clients.Learn from industry experts and influencers and make your own solutions more successful.Access exclusive community space, resources, tools, and support from Microsoft.Collaborate on projects, share best practices, and empower each other. These are just a few of the reasons why our community members love their User Groups. Don't wait. Get involved with (or maybe even start) a User Group today--just follow the tips below to get started.For current or new User Group leaders, all the information you need is here: User Group Leader Get Started GuideOnce you've kicked off your User Group, find the resources you need:  Community User Group ExperienceHave questions about our Community User Groups? Let us know! We are here to help you!

Super User of the Month | Ahmed Salih

We're thrilled to announce that Ahmed Salih is our Super User of the Month for April 2024. Ahmed has been one of our most active Super Users this year--in fact, he kicked off the year in our Community with this great video reminder of why being a Super User has been so important to him!   Ahmed is the Senior Power Platform Architect at Saint Jude's Children's Research Hospital in Memphis. He's been a Super User for two seasons and is also a Microsoft MVP! He's celebrating his 3rd year being active in the Community--and he's received more than 500 kudos while authoring nearly 300 solutions. Ahmed's contributions to the Super User in Training program has been invaluable, with his most recent session with SUIT highlighting an incredible amount of best practices and tips that have helped him achieve his success.   Ahmed's infectious enthusiasm and boundless energy are a key reason why so many Community members appreciate how he brings his personality--and expertise--to every interaction. With all the solutions he provides, his willingness to help the Community learn more about Power Platform, and his sheer joy in life, we are pleased to celebrate Ahmed and all his contributions! You can find him in the Community and on LinkedIn. Congratulations, Ahmed--thank you for being a SUPER user!  

Top Solution Authors
Top Kudoed Authors
Users online (5,012)