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 / Gallery Lookup with se...
Power Apps
Answered

Gallery Lookup with searchBox

(0) ShareShare
ReportReport
Posted on by 519

Hello,

I am trying to make signin with a searchbox, so the user can search their, the list of name is from another list, so would need to 'lookup' type and the source is 'StaffNames'

 

AndyPowerAppNew_0-1673006240004.png

Then it would update another list called 'staffwhoin' with the signin time

 

AndyPowerAppNew_1-1673006379587.png

is this possible? i can it working using a dropdownbox, but would like searchbox instead.

 

 

 

Categories:
  • BCBuizer Profile Picture
    22,895 Super User 2026 Season 2 on at

    Hi @AndyPowerAppNew ,

     

    There's a few things:

    1. After StaffNames, there's a comma missing in your code.

    2. ThisItem refers to the item in the gallery and you have to match data sources in your Patch function to use ThisItem. In your case you have two patch functions with different data sources that both use ThisItem, so that won't work.

    3. There seems to be a reset function in a wrong spot since that shouldn't be nested in the second Patch function.

     

    Assuming that the datasource for the gallery is StaffWhosIn, the code should look like:

     

    Patch(
    	StaffNames,
    	LookUp(StaffNames, Name=ThisItem.Name),
    	{Status: {Value:"Signed In"}}
    );
    
    Patch(
    	StaffWhosIn,
    	ThisItem,
    	{SignIn: Now()}
    );
    
    Reset(TextInputStaff_1);

     

     You probably will have to change the identifiers of the columns in the LookUp function to match the ones you are using.

  • AndyPowerAppNew Profile Picture
    519 on at

    Hello @BCBuizer ,

     

    I have tried this, i get some errors -

    This will be the staff sign in screen

    AndyPowerAppNew_0-1673008600069.png

    When users are searching their name, it will get from 'StaffNames' SP list. what code would need go into the gallery items?

     

    What code would i need to put on the "SignIn" button' onSelect?

     

    Sorry i dont understand what you mean about "ThisItem"

     

    Thank you kindly 🙂

  • BCBuizer Profile Picture
    22,895 Super User 2026 Season 2 on at

    Hi @AndyPowerAppNew ,

     

    It seems my assumption about the data source for the gallery was wrong.

     

    Please try the below for the OnSelect property of the "Sign In" button when StaffNames is used as the data source for the gallery:

     

     

    Patch(
    	StaffNames,
    	ThisItem,
    	{Status: {Value:"Signed In"}}
    );
    
    Patch(
    	StaffWhosIn,
    	LookUp(StaffWhosIn, Name.Value=ThisItem.Name),
    	{SignIn: Now()}
    );
    
    Reset(TextInputStaff_1);

     

     

  • AndyPowerAppNew Profile Picture
    519 on at

     Hi @BCBuizer , I have put the above code on the 'OnSelect'

    AndyPowerAppNew_0-1673009496855.png

    do i add the same to the same code to the 'Items' on the gallery? what have i done wrong there ?

     

    Thanks again, you are super helpful to me

  • BCBuizer Profile Picture
    22,895 Super User 2026 Season 2 on at

    HI @AndyPowerAppNew ,

     

    To get this code to work for the OnSelect property of the "Check in" button, you probably need to change the names of the column identifiers. From what I can see from one of your other topics, you have a LookUp column in the StaffWhosIn list (Name) that uses the Title column from the StaffNames list as a source. This means a little change in the code:

     

     

    Patch(
    	StaffNames,
    	ThisItem,
    	{Status: {Value:"Signed In"}}
    );
    
    Patch(
    	StaffWhosIn,
    	LookUp(StaffWhosIn, Name.Value=ThisItem.Title),
    	{SignIn: Now()}
    );
    
    Reset(TextInputStaff_1);

     

     

    As for the Items property of the gallery, that could look like:

     

     

    Search(
    	StaffNames,
    	TextInputStaff_1.Text,
    	Title
    )

     

     

  • AndyPowerAppNew Profile Picture
    519 on at

    Hi @BCBuizer , sorry i get cant get to work,

    AndyPowerAppNew_0-1673011521194.png

    The above is in the 'Items' for the gallery

    The below code is on the button:

    AndyPowerAppNew_1-1673011588779.png

     

    what infomation would you need from me so we can get this working please ?

     

    Thank you 🙂 sorry im trying my best to understand.

     

  • BCBuizer Profile Picture
    22,895 Super User 2026 Season 2 on at

     @AndyPowerAppNew ,

     

    Can you please share the error text for the Gallery's Items property?

     

    For the button's OnSelect property, please literally copy/paste the code from my previous reply. If you still get errors after, please share the error text.

     

     

     

  • AndyPowerAppNew Profile Picture
    519 on at

    Hello @BCBuizer ,

     

    That is now displaying the list of names, and when i press 'SignIn' it fills in the 'SignIn' column, but the status part, there is a choice box, doesnt work, as its meant to check if they are signed in, then in the 'Status' coloum say 'Signed In' then it removes the name from the list.

     

    does that make sense?

     

    Thanks

     

  • BCBuizer Profile Picture
    22,895 Super User 2026 Season 2 on at

    Hi @AndyPowerAppNew ,

     

    In your description, please be more specific because I'm struggling to understand what you mean when talking about "That is now displaying" (what is displaying?) and "the status part" (of what?).

     

    However, if I understood correctly you want to remove items from the gallery that have "Signed In" as their status. To do that a filter needs to be added to the Items property of the gallery:

     

    Search(
    	Filter(
    		StaffNames,
    		Status.Value= "Signed In"
    	),
    	TextInputStaff_1.Text,
    	Title
    )

     

  • AndyPowerAppNew Profile Picture
    519 on at

    Hi @BCBuizer , sorry , so when user types in name, it woulg get the name from the "StaffNames" which is a lookup, then when "Submit" is pressed it would change the 'Status' column in "StaffWhosIn" to "Signed In" then when user checks out it would then update the "Status" column in "StaffWhosIn" list to "SignedOut"

     

    Also within this, when the user has signedin, it filters and does show this on the signin screen, and same for the signout screen but filters the "Signed Out"

     

    Does this help?

     

    Thank you so much

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 352 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 323

#3
Mohsin Ali Profile Picture

Mohsin Ali 226

Last 30 days Overall leaderboard