cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
johnsoep
Level: Powered On

Search more than one column to populate gallery Items

I am trying to create a Time Log program for our Student Workers to use to keep track of their time worked. I have a list in our department's SharePoint page designed with the columns: Name, Signed_In, Signed_Out, Hours_Worked. I have one screen that has a button tied into a Flow which creates a new item in the list and populates the Name with the Students Name and the current date (Now) into the Signed_In field.

 

I also have a button that takes the user to a second screen that uses a Gallery to show all the time records for the user which uses SortByColumns(Search('Student Time Log',NameBox.Text,"Name"),"Signed_In",Ascending) to populate the gallery. This function is currently working just fine.

 

I have third button that goes to another screen and here I want to show all records where the student hasn't signed out for the day. So the logic I want here is where the name = student's name, Signed_out is empty, and Signed_In >= Now-1. My problem is that I don't think the Search function can support multiple columns/variables.

 

Is there a way that I can tell PowerApps gallery to query a table for 2 to 3 variables?

1 ACCEPTED SOLUTION

Accepted Solutions
Power Apps Staff Abdou
Power Apps Staff

Re: Search more than one column to populate gallery Items

Hi John,

 

There is indeed a way to to "filter" by more than one variable. This can be achieved by using, you guessed it, the "Filter" function 🙂

For your example, you would need a formula similar to this:

Filter('Student Time Log", Name = NameBox.Text, Signed_Out = "", Signed_In >= Now() - 1)

Hope this helps 🙂

View solution in original post

3 REPLIES 3
Power Apps Staff Abdou
Power Apps Staff

Re: Search more than one column to populate gallery Items

Hi John,

 

There is indeed a way to to "filter" by more than one variable. This can be achieved by using, you guessed it, the "Filter" function 🙂

For your example, you would need a formula similar to this:

Filter('Student Time Log", Name = NameBox.Text, Signed_Out = "", Signed_In >= Now() - 1)

Hope this helps 🙂

View solution in original post

Community Support Team
Community Support Team

Re: Search more than one column to populate gallery Items

Hi Johnsoep,

 

May I suggest you use And function? This article about And function could be a reference for you:
https://powerapps.microsoft.com/en-us/tutorials/function-logicals/

 

You could combine And function with Filter function or other functions. This thread for a reference:
https://powerusers.microsoft.com/t5/PowerApps-Forum/Multiple-Filters/m-p/7413#M3353

 

If you need more help, please feel free reply.


Best regards,
Mabel Mao

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
johnsoep
Level: Powered On

Re: Search more than one column to populate gallery Items


@Abdou wrote:

Hi John,

 

There is indeed a way to to "filter" by more than one variable. This can be achieved by using, you guessed it, the "Filter" function 🙂

For your example, you would need a formula similar to this:

Filter('Student Time Log", Name = NameBox.Text, Signed_Out = "", Signed_In >= Now() - 1)

Hope this helps 🙂


Thanks! This is exactly what I needed, it works perfectly now!

Helpful resources

Announcements
thirdimage

Power Apps Super User Class of 2020

Check it out!

thirdimage

New Badges

Check it out!

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors
Users online (3,804)