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
PowerApps Staff Abdou
PowerApps 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 Smiley Happy

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 Smiley Happy

3 REPLIES 3
PowerApps Staff Abdou
PowerApps 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 Smiley Happy

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 Smiley Happy

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 Smiley Happy

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 Smiley Happy


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

Helpful resources

Announcements
firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

SecondImage

PowerApps Monthly Community Call

Tomorrow, September 18th at 8am PDT

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

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

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

SecondImage

Power Platform Summit North America

Register by September 5 to save $200

Top Kudoed Authors
Users Online
Currently online: 225 members 4,718 guests
Please welcome our newest community members: