cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
motami
Frequent Visitor

Sorting a Gallery by columns from dropdown and searching/filtering it with a textbox

Hi there,

 

I'm new to Powerapps (and have no programming background) and I'm building an app for work where we set permissions for employees. The employee name is selected from a dropdown box that does not allow user input.

 

screen_1.jpg

 

 

The 1st screen of the app is a browse screen where I have a textbox to search for employee names to open their permission screen to view or edit as necessary.

 

screen_2.jpg

 

 

What I would like to do (and haven't been able to all week) is:

 

1st - Sort the gallery by columns from the dropdown values where I choose the employess when registering them, so I can use the ascending/descending button at the top of the browse screen.

 

2nd - Use the textbox on the browse screen to search and filter the gallery by the name of the employee.

 

Any help is appreciated, as this has been giving me headaches for the past week.

 

Thanks,

 

Miguel

 

EDIT: I managed to find out how to do both in a single formula after much trial and error:

Sort(Filter(AIRC;StartsWith(Nomes.Value; TextInput1.Text)); Nomes.Value; Ascending)

 New question:

 

Is there anyway to make it so the text I input is searched anywhere in the line, not just in the beginning? For example, searching for a surname and getting all employees with that surname, no matter where in the full name it is?

 

 

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @v-monli-msft,

 

Thank you for your answer but like I said in my Edit in my original post, I managed to find out how to get it working.

 

Thanks for your time,

 

Miguel

View solution in original post

2 REPLIES 2
v-monli-msft
Community Support
Community Support

Hi @motami,

 

There is a function Search that finds records in a table that contain a string in one of their columns. The string may occur anywhere within the column. But it seems that Search function won't work with People and Group field.

 

So far we could only use Filter to achieve this. Please test with below formula:

SortByColumns(Filter(AIRC, StartsWith(Person.DisplayName, TextSearchBox1.Text),Dropdown1.Selected.Value=Person.DisplayName), Person,  Ascending)

Regards,

Mona

Community Support Team _ Mona Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @v-monli-msft,

 

Thank you for your answer but like I said in my Edit in my original post, I managed to find out how to get it working.

 

Thanks for your time,

 

Miguel

View solution in original post

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Top Solution Authors
Top Kudoed Authors
Users online (35,592)