I need to search a gallery using a combobox for the ability to use the Search fields property. My dropdown search fields display All if no choice is made or Result = "0" but when using the same function in the Items property of the combobox, not all of the items display adn the InputTextPlaceholder property displays. The following is the function I am using. Apparently the Value != 0 when nothing is chosen. What am I missing?
With({_items: Sort(Distinct(EmpDB, LUContractName.Value), Result)},
ForAll(Sequence(CountRows(_items)+1, 0),
{Result: If(Value=0, "All", Last(FirstN(_items, Value)).Result )}
)
)
Solved! Go to Solution.
Hi @GoGorilla ,
The thing is Combo boxes allow empty selection when you have not set the DefaultSelectedItems property of it, while the Dropdowns will have their AllowEmptySelection be false by default:
So, if you want "All" to be selected by default in the Combo box, set DefaultSelectedItems to
{Result:"All"}
Hope this helps.
Best regards,
Community Support Team _ Jeffer Ni
If this post helps, then please consider Accept it as the solution to help the other members find it.
Community Support Team _ Jeffer Ni
If this post helps, then please consider Accept it as the solution to help the other members find it.
I'm not exactly following what the issue is. You have that formula on your Items property of the Combobox...are you stating that the Items do not appear properly?
Your Combobox is going to have (with that formula) a single column table with a column called Result, so I am not sure what you are comparing with the Value != 0 statement.
Can you expand a little more please?
@RandyHayes In the image attached, note that the other dropdowns show All where the combo box shows the find items for searching the field. In the combo box, if the All is not default, when doing a search by Employee name in the Employee Name text search, it will not find every employee. If I change the combo box to All, then it finds everyone. I am not sure why this is happening. All of the search text fields and dropdowns worked fine until I added the combobox. The result should be if value = 0 then display All but the value apparently is not 0.
@RandyHayes What was happening was the default value for the combobox is blank therefore, it would only display those with no value in the Contracts field; therefore, when trying to use the text search fields, it would only find those with blank Contract values. I set the DefaultSelectedItem property to {Result: "All"}. This fixed the problem. Thank you for your help.
Hi @GoGorilla ,
The thing is Combo boxes allow empty selection when you have not set the DefaultSelectedItems property of it, while the Dropdowns will have their AllowEmptySelection be false by default:
So, if you want "All" to be selected by default in the Combo box, set DefaultSelectedItems to
{Result:"All"}
Hope this helps.
Best regards,
Community Support Team _ Jeffer Ni
If this post helps, then please consider Accept it as the solution to help the other members find it.
Community Support Team _ Jeffer Ni
If this post helps, then please consider Accept it as the solution to help the other members find it.
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
User | Count |
---|---|
167 | |
94 | |
68 | |
64 | |
63 |
User | Count |
---|---|
222 | |
160 | |
94 | |
85 | |
80 |