cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
saurabhtalele
Helper I
Helper I

filter gallery based on dynamically selected value from drop down

respected sir,

 

I have some problem

 

1- made a drop-down of a column name which is in sharepoint

1.png

 

2=

2.png

 

if I write notify on gallery I can get Fname And Lname there

 

But while searching from text box its not working why?

 

thanks 

 

your faithfully 

saurabh

2 ACCEPTED SOLUTIONS

Accepted Solutions
klaasdejong
Frequent Visitor

I don't know of a way in which you can dynamically refer to a column name in Power FX unfortunately.

 

You could do this if you insist on using the dropdown:

 

 

If(
	Dropdown1.Selected.Value = "Fname",
	Filter(yourDataSource,Startswith("Fname",TextInput1.text)),
	Dropdown1.Selected.Value = "Lname",
	Filter(yourDataSource,Startswith("Lname",TextInput1.text))
)

 

 

Do you have a reason why you wouldn't just use this:

 

 

Filter(yourDataSource,
	Startswith("Fname",TextInput1.text) || Startswith("Lname",TextInput1.text)
)

 

 

|| is or

View solution in original post

theapurva
Super User
Super User

Hello,
Could you please explain the scenario a bit more?

can you tell us the Notify() formula to understand your requirement?

 

ideal case is this:
Items of Gallery: 

Filter(yourlistname,YourColumnName=Dropdown1.Selected.Value, StartsWith(YourColumn2,Textbox1.Text)

 

----------------------------------------------------------------------------------------------------------------------
Please 'Mark as Solution' if someone's post answered your question and always 'Thumbs Up' the posts you like or that helped you!

View solution in original post

4 REPLIES 4
saurabhtalele
Helper I
Helper I

i want to do like this

https://youtu.be/dIhLvvrzC00

klaasdejong
Frequent Visitor

I don't know of a way in which you can dynamically refer to a column name in Power FX unfortunately.

 

You could do this if you insist on using the dropdown:

 

 

If(
	Dropdown1.Selected.Value = "Fname",
	Filter(yourDataSource,Startswith("Fname",TextInput1.text)),
	Dropdown1.Selected.Value = "Lname",
	Filter(yourDataSource,Startswith("Lname",TextInput1.text))
)

 

 

Do you have a reason why you wouldn't just use this:

 

 

Filter(yourDataSource,
	Startswith("Fname",TextInput1.text) || Startswith("Lname",TextInput1.text)
)

 

 

|| is or

theapurva
Super User
Super User

Hello,
Could you please explain the scenario a bit more?

can you tell us the Notify() formula to understand your requirement?

 

ideal case is this:
Items of Gallery: 

Filter(yourlistname,YourColumnName=Dropdown1.Selected.Value, StartsWith(YourColumn2,Textbox1.Text)

 

----------------------------------------------------------------------------------------------------------------------
Please 'Mark as Solution' if someone's post answered your question and always 'Thumbs Up' the posts you like or that helped you!

You can also use search:

Search(yourDataSource, TextInput1.text, "Fname", "Lname", "anyOtherColumn")

 And it will return results from all specified columns.

 

Make sure you understand delegation when you apply this in your application, as search results may not work if your data source does not support delegating search to the server. In that case search will only work with what Power Apps can cache, which is a value between 1 and 2000 which you can set yourself in the settings. Default is 500. You could easily be missing items and not notice if the data source has items beyond that range.

klaasdejong_0-1655733013525.png

Info on delegation: https://docs.microsoft.com/en-us/power-apps/maker/canvas-apps/functions/function-filter-lookup#deleg...

Helpful resources

Announcements
Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Users online (1,421)