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 / Lookup within patch no...
Power Apps
Answered

Lookup within patch not working

(1) ShareShare
ReportReport
Posted on by

I use a gallery with checkboxes:

 

biancadevera_1-1678792104126.png

 

I have other line item aside from Shift A which are Shift B, Shift C, and Shift D. Whenever I select the checkboxes for the other shifts, it only updates the Shift A line. I'm also using LookUp to find the shift. Here's the code I'm currently using.

 

All - checkbox

OnCheck

Patch(db,
LookUp(db,lblEmployees.Text = ThisItem.Employee.Value),
{All: true,
EmpA: true,
EmpB: true,
EmpC: true,
EmpD: true
});

 

OnUnCheck

Patch(db,
LookUp(db,lblEmployees.Text = ThisItem.Employee.Value),
{All: false,
EmpA: false,
EmpB: false,
EmpC: false,
EmpD: false
});

 

I think I'm missing something on my LookUp function. Please help.

Categories:
  • Verified answer
    KeithAtherton Profile Picture
    3,709 Most Valuable Professional on at

    Hi @biancadevera,

     

    I would expect the LookUp function call to lookup the record in the data source db but the following code may be comparing a control value (lblEmployees.Text) with the record value (ThisItem.Employee.Value):

    LookUp(db,lblEmployees.Text = ThisItem.Employee.Value)

     

    Try something similar to the following code, where the control value (lblEmployees.Text) has been replaced by the column in the data source (EmployeeID - change this to the column name required):

    LookUp(db,EmployeeID = ThisItem.Employee.Value)

    If I have answered your question, please mark your post as Solved.
    If you like my response, please give it a Thumbs Up.

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 381 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 340

#3
WarrenBelz Profile Picture

WarrenBelz 187 Most Valuable Professional

Last 30 days Overall leaderboard