cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
cyberco01
Post Prodigy
Post Prodigy

Combobox SearchText not working in Powerapps

I have added the below code in my combo-box items and defaultselecteditems as follows :-

SortByColumns(ShowColumns(FirstN(Search(Filter(VendorsV2_3,TextInput1.Text in 'Search name'), TextInput1.Text, "VendorSearchName"),50),"VendorSearchName"),"VendorSearchName",Ascending)

 

This works perfectly fine, if i put a text-box above the combo-box and search in the text-box and corresponding value gets filtered in the combo-box.

But when i replace the TextInput1.Text to Combobox1.SearchText, nothing happens.

Can anyone please help me with this.

1 ACCEPTED SOLUTION

Accepted Solutions

@cyberco01 

 

You can try to simplify your formula as:
 
Distinct(Sort(FirstN(
    Search(Filter(VendorsV2_3,StartsWith(Name,ComboBox3.SearchText) || StartsWith(description,ComboBox3.SearchText)),ComboBox3.SearchText,VendorOrganizationName),50),VendorOrganizationName,Ascending),VendorOrganizationName).Result
Hope this Helps!
 
If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

View solution in original post

8 REPLIES 8

Hey @cyberco01 

 

Can you please try to modify your code as:
 
SortByColumns(ShowColumns(FirstN(Search(Filter(VendorsV2_3,StartsWith('Search name',Combobox1.SearchText)),  Combobox1.SearchText, "VendorSearchName"),50),"VendorSearchName"),"VendorSearchName",Ascending)
Hope this Helps!
 
If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

@yashag2255 ,

It is giving me error - StartsWith has an invalid argument. Kindly help.

Also, it is giving me the large dataset warning.

Please check below my exact issue with the first combo box on screen.

 

Combo-box Issue.gif

@cyberco01 

 

Please share a screenshot of the error that you are getting. Can you please confirm that the 'Search name' attribute is a string type?

@yashag2255 ,

I have shared the video of my exact issue. Please do let me know if you are able to see.

@cyberco01 

 

Can you please more the snippets of the properties that you have modified in the default properties of combobox. I am guessing this is something because of the defaultselecteditems property. 

@yashag2255 ,

I removed the code from defaultselecteditems field and now I am able to search the vendors.

But, now the saving is not happening. As in I select a vendor and save the item and then open for edit but unable to see it.

 

Currently, code in my items property is 

SortByColumns(ShowColumns(FirstN(Search(Filter(VendorsV2_3,ComboBox2.SearchText in 'Search name'), ComboBox2.SearchText, "VendorSearchName"),50),"VendorSearchName"),"VendorSearchName",Ascending)

Dearies,

@yashag2255 @v-xida-msft

 

Kindly help me with this issue as the value i save is not reflected in combo-box in edit mode.

 

Update property of datacard: ComboBox3.Selected.Result

Items Property: Distinct(SortByColumns(ShowColumns(FirstN(Search(Filter(VendorsV2_3,ComboBox3.SearchText in 'Name or description'), ComboBox3.SearchText, "VendorOrganizationName"),50),"VendorOrganizationName"),"VendorOrganizationName",Ascending),VendorOrganizationName).Result

 

 

 

@cyberco01 

 

You can try to simplify your formula as:
 
Distinct(Sort(FirstN(
    Search(Filter(VendorsV2_3,StartsWith(Name,ComboBox3.SearchText) || StartsWith(description,ComboBox3.SearchText)),ComboBox3.SearchText,VendorOrganizationName),50),VendorOrganizationName,Ascending),VendorOrganizationName).Result
Hope this Helps!
 
If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (5,759)