cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
AnastasiaD
Regular Visitor

Extracting ComboBox SearchText on-the-fly

Hi.
I extract data from ComboBox to a variable. It might be a Selected item if Combobox has drop-down option, or it might be a user input (which is technically SearchText property).
So I put this code on both ComboBox OnSelect and OnChange: 

Set(MyOutput, If(IsBlank(Self.Selected.AttrOption), Self.SearchText, Self.Selected.AttrOption)).
And it works in general, but with one shortage: when it involves SearchText, I have to click on ComboBox for the second time after search text is typed. And I perfectly see why: the text is typed after OnSelect activates, and search typing doesn't activate OnChange. What I need is some "OnRelease" property! I know...
So any ideas how to improve this are welcome!

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
AnastasiaD
Regular Visitor

I changed my scenario and extract all data upon Button click, not field by field. Simply something like that:

ForAll(Gallery3.AllItems,
If (IsBlank(ComboBox1.Selected.AttrOption),

Collect(NewNom,
{AttributeName: AttributeName,
UserValue: ComboBox1.SearchText}),

Collect(NewNom,
{AttributeName: AttributeName,
UserValue: ComboBox1.Selected.AttrOption})));

View solution in original post

3 REPLIES 3
v-qiaqi-msft
Community Support
Community Support

Hi @AnastasiaD,

Do you want to trigger the variable once you input the SearchText?

Could you please share a bit more about the scenario?

Actually, it is an known issue that the OnChange property means that how the app responds when the user changes a selection, so it makes no sense when you refer to the ComboBox.SearchText.

If you want to trigger the variable as soon as you enter the SearchText within the Combo Box, I am afraid that there is no way to achieve this currently in Power Apps.

If you want this feature to be added, please raise a new idea in our idea forum.

Ideas - Power Platform Community (microsoft.com)

As an alternative solution, if you could accept a newly added button, I think you could move your formula from the OnChange && OnSelect property of the Combo Box to the OnSelect property of the newly added button.

Hope it could help you.

Regards,

Qi

Best Regards,
Qi

Hi! Thank you for you attention.

Scenario is that user is filling a form (some order fields) created dynamically upon an order type (fields are filtered from a big table). This is a Gallery control. ComboBoxes are on a Gallery control alongside of the fields names. So it's basically only one ComboBox control. I was picking each entered value one by one and putting it in a right place in a Collection (forming a final order) because I can't understand how to pick all ComboBoxes values massive from a Gallery control in the end upon Button click. So maybe the question should be: How to get ComboBox Data for all gallery items at once? Does it make sense? Or am I missing some obvious out-of-the-box solution?

AnastasiaD
Regular Visitor

I changed my scenario and extract all data upon Button click, not field by field. Simply something like that:

ForAll(Gallery3.AllItems,
If (IsBlank(ComboBox1.Selected.AttrOption),

Collect(NewNom,
{AttributeName: AttributeName,
UserValue: ComboBox1.SearchText}),

Collect(NewNom,
{AttributeName: AttributeName,
UserValue: ComboBox1.Selected.AttrOption})));

View solution in original post

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (2,418)