Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Power Apps Pro Dev & ISV
Answered

Patching Update to two Sharepoint tables for all selected Items in a gallery

(1) ShareShare
ReportReport
Posted on by 120
Hi 
 
I have a gallery (glyupload_3) which is a collection bringing two sharepoint list together. I am trying to patch back to both sharepoint lists the Uploaded Date (todays date) for all the selected lines in the gallery. The below formula only patched back the first line from the gallery to the sharepoint lists which i am aware is because it is referencing the first line in the gallery. How do i get it to loop through all the lines in the gallery which have been selected? 
 
ForAll(
    Filter(
        glyupload_3.AllItems,
        Checkbox3_1.Value
    ) As DATA,
    Patch(
        'Requisition Main',
        LookUp(
            'Requisition Main',
            'Order Number' = Label68_143.Text
        ),
        {'Uploaded Date': DatePicker1_3.SelectedDate}
    )
);
ForAll(
    Filter(
        glyupload_3.AllItems,
        Checkbox3_1.Value
    ) As DATA,
    Patch(
        'Requisition Line Item',
        LookUp(
            'Requisition Line Item',
            'Item Number' = Label68_144.Text
        ),
        {'Uploaded Date': DatePicker1_3.SelectedDate}
    )
)
 
Many thanks
 
Chris 
  • Verified answer
    DJ_Jamba Profile Picture
    2,730 Super User 2025 Season 1 on at
    Patching Update to two Sharepoint tables for all selected Items in a gallery
    Assuming the two labels (Label68_143, Label68_144) are in the gallery and not sure if the date picker (DatePicker1_3) is in the gallery but will say yes for now, you simply need to prefix those controls in your patch with DATA, so something like this:
     
    ForAll(
        Filter(
            glyupload_3.AllItems,
            Checkbox3_1.Value
        ) As DATA,
        With(
            {
                L143: Trim(DATA.Label68_143.Text),
                L144: Trim(DATA.Label68_144.Text)
            },
            Concurrent(
                Patch(
                    'Requisition Main',
                    LookUp(
                        'Requisition Main',
                        'Order Number' = L143
                    ),
                    {'Uploaded Date': DATA.DatePicker1_3.SelectedDate}
                ),
                Patch(
                    'Requisition Line Item',
                    LookUp(
                        'Requisition Line Item',
                        'Item Number' = L144
                    ),
                    {'Uploaded Date': DATA.DatePicker1_3.SelectedDate}
                )
            )
        )
    )

    Or, if the date picker is not in the gallery:
     
    ForAll(
        Filter(
            glyupload_3.AllItems,
            Checkbox3_1.Value
        ) As DATA,
        With(
            {
                L143: Trim(DATA.Label68_143.Text),
                L144: Trim(DATA.Label68_144.Text)
            },
            Concurrent(
                Patch(
                    'Requisition Main',
                    LookUp(
                        'Requisition Main',
                        'Order Number' = L143
                    ),
                    {'Uploaded Date': DatePicker1_3.SelectedDate}
                ),
                Patch(
                    'Requisition Line Item',
                    LookUp(
                        'Requisition Line Item',
                        'Item Number' = L144
                    ),
                    {'Uploaded Date': DatePicker1_3.SelectedDate}
                )
            )
        )
    )


     

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,518 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,734 Most Valuable Professional

Leaderboard