cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
iwonder
Impactful Individual
Impactful Individual

Search function with dynamic set of fields

Thank you for taking the time to read my question.

 

I have a combo box with a list of table fields in it. I am using the .SelectedItems to create a string of Field Names that I thought I could use in my Select() function

 

Field Name String

 

With({FieldList:Concat(ComboBox1.SelectedItems,"""" & tFields & """" & ",")}, Left(FieldList,Len(FieldList)-1))

 

 

Search()

 

Search(colAssets,TextInput1.Text,With({FieldList:Concat(ComboBox1.SelectedItems,"""" & tFields & """" & ",")}, Left(FieldList,Len(FieldList)-1)))

 

 

but I'm getting an error saying that Search is expecting a string where the With() starts.

 

Is there a proper way to generate a dynamic list of fields in which to search based on users selection?

 

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
BCLS776
Super User
Super User

Unfortunately, Power Apps doesn't support using column names in a dynamic, runtime form such as this. Is there anything stopping you from listing all the possible columns in the Search() function?

 

Bryan

_________________________________________________________________________________________
Help the community help more users by choosing to "Accept as Solution" if this post met your needs. If you liked the post and want to show some appreciation, please give it a Thumbs Up.

View solution in original post

2 REPLIES 2
BCLS776
Super User
Super User

Unfortunately, Power Apps doesn't support using column names in a dynamic, runtime form such as this. Is there anything stopping you from listing all the possible columns in the Search() function?

 

Bryan

_________________________________________________________________________________________
Help the community help more users by choosing to "Accept as Solution" if this post met your needs. If you liked the post and want to show some appreciation, please give it a Thumbs Up.
iwonder
Impactful Individual
Impactful Individual

Hi Bryan,

 

Thank you for the info. I guess that will have to be the only way. The group wanted to be able to define what fields they search in.

 

have a great day

Helpful resources

Announcements
PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

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