Hello,
I'd like to display the values of a Collection, inside Dropdowns rather than Text Boxes. This is so a User can edit a record in the Collection and only choose from specific values when editing.
Heres the collection:
When I set the Dropdown value to ThisItem.value (just like a Text box), the Dropdowns remain blank.
Is it possible in PowerApps to show the value of a Collection in a Dropdown?
Thanks
Solved! Go to Solution.
Hi @ericonline,
Could you please share a bit more about your app's configuration?
Is the Edit form connected to the Collection (colWorkSummary)?
Further, do you want to display event_type value of the Collection within the Select Type Drop down control and display event_detail value of the Collection within the Select Detail Drop down control?
I have made a test on my side, please take a try with the following workaround:
Set the OnVisible property of the Screen to following formula:
ClearCollect(
colWorkSummary,
{
comments:"No comments",
event_detail:"Ditching",
event_type:"Production",
hours2:"08",
id:1,
minutes:"00"
},
{
comments:"No comments",
event_detail:"Ditching1",
event_type:"Development",
hours2:"12",
id:1,
minutes:"30"
}
)
Set the Items property of the SelectType Drop down control to following formula:
Distinct(colWorkSummary,event_type)
Set the Items property of the SlectDetail Drop down control to following formula:
Distinct(colWorkSummary,event_detail)
On your side, please take a try to set the Default property of the Select Type Drop down control to following formula:
ThisItem.event_type
Set the Default property of the Select Detail Drop down control to following formula:
ThisItem.event_detail
Or
Set the Items property of the Select Type Drop down control to following formula:
Distinct(colWorkSummary,event_type)
Set the Items property of the Select Detail Drop down control to following formula:
Distinct(colWorkSummary,event_detail)
Best regards,
Kris
Hi ericonline,
I often use dropdowns to control input into plain text columns - makes the data source so much flatter and easier to manage.
The dropdown control accepts arrays as hardcoded options for the dropdown, so
Items property on dropdown:
["option 1", "option 2", "option 3"]
The default value of the dropdown can then be what the current recorded value of the field is, as long as it's part of that array it will display - assuming you're only using this control to capture data, this should always be the case.
Default property on dropdown:
ThisItem.ColumnName
If you want the options to be more dynamic (as in, coming from the column itself, or another data source) this is also easy enough. Let me know if this helps, otherwise we can explore a bit more 🙂
[edit]
Reading your question, it might be worth adding this piece;
If you want the values to come from the existing collection itself, change the Items property function as follows;
Distinct('Source', ColumnName)
and set the Value sub-field to Result if it doesn't do it automatically. The default value can stay as mentioned above.
This will create a dropdown of existing values - just bear in mind you may encounter delegation issues (and take a performance hit) if the query has to return a full 500 rows before determining the Distinct values of those 500 rows.
If you know what your values need to be, better to hard code them, or fetch them from a lookup list/column somewhere that is unlikely to change.
Kind regards,
RT
Hi @ericonline,
Could you please share a bit more about your app's configuration?
Is the Edit form connected to the Collection (colWorkSummary)?
Further, do you want to display event_type value of the Collection within the Select Type Drop down control and display event_detail value of the Collection within the Select Detail Drop down control?
I have made a test on my side, please take a try with the following workaround:
Set the OnVisible property of the Screen to following formula:
ClearCollect(
colWorkSummary,
{
comments:"No comments",
event_detail:"Ditching",
event_type:"Production",
hours2:"08",
id:1,
minutes:"00"
},
{
comments:"No comments",
event_detail:"Ditching1",
event_type:"Development",
hours2:"12",
id:1,
minutes:"30"
}
)
Set the Items property of the SelectType Drop down control to following formula:
Distinct(colWorkSummary,event_type)
Set the Items property of the SlectDetail Drop down control to following formula:
Distinct(colWorkSummary,event_detail)
On your side, please take a try to set the Default property of the Select Type Drop down control to following formula:
ThisItem.event_type
Set the Default property of the Select Detail Drop down control to following formula:
ThisItem.event_detail
Or
Set the Items property of the Select Type Drop down control to following formula:
Distinct(colWorkSummary,event_type)
Set the Items property of the Select Detail Drop down control to following formula:
Distinct(colWorkSummary,event_detail)
Best regards,
Kris
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
User | Count |
---|---|
199 | |
52 | |
41 | |
39 | |
35 |
User | Count |
---|---|
261 | |
86 | |
71 | |
70 | |
66 |