cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Super User
Super User

Display collection values in dropdown?

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: 

dropdownCollection2.png

When I set the Dropdown value to ThisItem.value (just like a Text box), the Dropdowns remain blank. 

dropdownCollection.png

 

Is it possible in PowerApps to show the value of a Collection in a Dropdown? 

 

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Display collection values in dropdown?

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:5.JPG

 

6.JPG

 

 

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

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
2 REPLIES 2
Super User
Super User

Re: Display collection values in dropdown?

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 Smiley Happy

 

[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

Community Support Team
Community Support Team

Re: Display collection values in dropdown?

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:5.JPG

 

6.JPG

 

 

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

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Top Community Contributors for July 2019

Top Community Contributors for July 2019

Let's thank our top community contributors

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

FifthImage

Dynamics 365 and Power Platform April 2019 Release notes

Features releasing from April 2019 through September 2019!

Users Online
Currently online: 173 members 5,410 guests
Please welcome our newest community members: