Dropdown1:
Items: _mycollection
ID | Name
1 | ABC
2 | DEF
...
IsSearchable: true
DisplayFields: "Name"
SearchFields: "ID"
However:
Combobox1 is EMPTY. No search, no select, nothing!
I'm just trying to understand the logic of this, and why it is so erratic.
Can anyone help?
Thanks in advance!
Solved! Go to Solution.
Actually, sorry the formula should have been this:
With({dt:Sort(Table, Name)},
ForAll(
Sequence(CountRows(dt)+1, 0),
If(Value=0, Patch(Defaults(Table),{Name:"_vazio"}), Last(FirstN(dt, Value)))
)
)
This will give you all of the columns from your record.
If you want to narrow to just Name and ID, then you can change to the following :
With({dt:Sort(Table, Name)},
ForAll(
Sequence(CountRows(dt)+1, 0),
If(Value=0, {Name:"_vazio", ID:0}, Last(FirstN(dt, Value)))
)
)
Please how is the collection created, Onvisible?
------------
If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.
Now I have closed and reopened the app and I get an error!
It wasn't there before I closed the app....
Anyway, here it is:
And what is Combobox1.SearchItems I don't know...
What is your collection on _mycollection defined as?
ClearCollect(__mycollection, {Name: "_vazio"});
Collect(_mycollection, Sort(Table, Name, Ascending))
So, let's take the collection out of the picture then as you don't need it for this combobox.
Set your Items formula to the following:
With({dt:Sort(Table, Name)},
ForAll(
Sequence(CountRows(dt)+1, 0),
If(Value=0, {Name:"_vazio"}, Last(FirstN(dt, Value)))
)
)
This will give you a dynamic list of sorted items with the first one being "_vazio"
Now, go through the Edit Fields on the combobox in the right properties pane of the designer and make sure that the Primary text and search text are as you want them.
Thanks,
That returns the error: "Name isn't valid. This identifier isn't recognized."
This works:
Sort(Table, Name, Ascending)
ALL I want is to add an empty "_vazio" at the beginning, so the user may select the empty values...
So the formula I provided you should have worked verbatim as-is.
Can you put it in place again and give me a screenshot of the formula with the error shown?
Sure, the formula works well on an empty screen.
It just doesn't work on the screen I want it.
User | Count |
---|---|
194 | |
126 | |
90 | |
48 | |
44 |
User | Count |
---|---|
280 | |
160 | |
138 | |
81 | |
76 |