cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
iwonder
Impactful Individual
Impactful Individual

Patch Gallery

Thank you for taking the time to read my question.

 

I am trying to loop through all the filtered results of my Gallery and patching the ones that have the checkbox checked.

 

This is my formula. When I type it in, it's fine but when I run it the Lookup() part gets the red underline.

 

iwonder_0-1605567521274.png

 

Also, the Patch doesn't happen and the record is not updated.

 

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
iwonder
Impactful Individual
Impactful Individual

I figured it out. I used RenameColumns() on the Gallery.

 

ForAll(
    RenameColumns(NewHistoricalPelleting.AllItems,"ID","RecID"),
    If(
        ThisRecord.chkUpdate.Value = true,
        Patch(
            PelletingRecord,
            LookUp(
                PelletingRecord,
                ID = RecID
            ),
            {
                QAReviewedDate: Now(),
                QAReviewedBy: User().Email,
                QAComments: QAComments.Text
            }
        )
    )
);
Notify(
    "All Done",
    NotificationType.Information
)

 

Thank you for your responses to my question.

View solution in original post

7 REPLIES 7
WarrenBelz
Super User
Super User

@iwonder ,

Can you please supply your formula as text.

PaulD1
Community Champion
Community Champion

Could you try turning on Performance Monitor and seeing if that gives any more detail about the error?

iwonder
Impactful Individual
Impactful Individual

Hi WarrenBelz,

 

Thank you for your reply.

 

Here is the formula as text:

ForAll(NewHistoricalPelleting.AllItems, If(ThisRecord.chkUpdate.Value = true, Patch(PelletingRecord,LookUp(PelletingRecord,ID = ThisRecord.ID ),{QAReviewedDate:Now(),QAReviewedBy:User().Email,QAComments:QAComments})));Notify("All Done",NotificationType.Information)

 

Thanks!

iwonder
Impactful Individual
Impactful Individual

Hi PaulD1

 

I am in Advanced Settings and I do not see Performance Monitor. Is there somewhere else I should be looking?

 

Thanks

iwonder
Impactful Individual
Impactful Individual

I found "Monitor"

 

iwonder_0-1605635553740.png

 

Is this helpful?

 

Thanks

iwonder
Impactful Individual
Impactful Individual

One thought.

Do I need to use RenameColumns()? The name of the columns are the same... they're both "ID". One "ID" is ThisRecord and the other is from PelletingRecord in SharePoint.

 

Thanks,

iwonder
Impactful Individual
Impactful Individual

I figured it out. I used RenameColumns() on the Gallery.

 

ForAll(
    RenameColumns(NewHistoricalPelleting.AllItems,"ID","RecID"),
    If(
        ThisRecord.chkUpdate.Value = true,
        Patch(
            PelletingRecord,
            LookUp(
                PelletingRecord,
                ID = RecID
            ),
            {
                QAReviewedDate: Now(),
                QAReviewedBy: User().Email,
                QAComments: QAComments.Text
            }
        )
    )
);
Notify(
    "All Done",
    NotificationType.Information
)

 

Thank you for your responses to my question.

Helpful resources

Announcements
PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Top Solution Authors
Top Kudoed Authors
Users online (1,405)