cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

Set Default Selection of Combobox when coming from the DetailScreen

I have a ComboBox with a dropdown list using ClearCollect in the first screen to set the dropdown values.  When viewing an existing record in the DetailScreen you can see the dropdown value that was selected (5cm), however when you then go into the EditScreen, this value disappears.  How do I get the EditScreen to show the dropdown values that have already been selected and saved on the record (it's a table in SP)?

 

The Dropdown list is on the Size Pricked field:

DetailScreenDetailScreenEditScreenEditScreen

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Hi @LeonieW ,

Could you please share a bit more about the formula that you typed within the Items property of the Size Pricked Combo Box within your Edit form?

Do you set the Items property of the Combo Box to a Collection?

Further, could you please share a bit more about your Collection?

 

I have made a test on my side, please take a try with the following workaround:8.JPG

 

7.JPG

Set the OnStart property of the App control or OnVisible property of the first screen to following:

ClearCollect(SizeCollection, "5cm", "10cm", "25cm","45cm", "1m", "2m")

Set the Items property of the ComboBox to following:

SizeCollection

Set the DefaultSelectedItems property of the ComboBox to following:

{
    Value: "5cm"
}

On your side, you should type:

{
    Value:  ThisItem.'Size Pricked' /* <-- 'Size Pricked' represents the column in your SP list, which used to store the ComboBox value */
}

Or

{
    ColumnName:  ThisItem.'Size Pricked'   /* <-- ColumnName represents the column from your collection, which you displayed within the ComboBox */
}

More details about setting a Default value for Combo Box control, please check and see if the following blog would help in your scenario:

https://powerapps.microsoft.com/en-us/blog/default-values-for-complex-sharepoint-types/

 

Best regards,

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.

View solution in original post

2 REPLIES 2
Highlighted
Community Support
Community Support

Hi @LeonieW ,

Could you please share a bit more about the formula that you typed within the Items property of the Size Pricked Combo Box within your Edit form?

Do you set the Items property of the Combo Box to a Collection?

Further, could you please share a bit more about your Collection?

 

I have made a test on my side, please take a try with the following workaround:8.JPG

 

7.JPG

Set the OnStart property of the App control or OnVisible property of the first screen to following:

ClearCollect(SizeCollection, "5cm", "10cm", "25cm","45cm", "1m", "2m")

Set the Items property of the ComboBox to following:

SizeCollection

Set the DefaultSelectedItems property of the ComboBox to following:

{
    Value: "5cm"
}

On your side, you should type:

{
    Value:  ThisItem.'Size Pricked' /* <-- 'Size Pricked' represents the column in your SP list, which used to store the ComboBox value */
}

Or

{
    ColumnName:  ThisItem.'Size Pricked'   /* <-- ColumnName represents the column from your collection, which you displayed within the ComboBox */
}

More details about setting a Default value for Combo Box control, please check and see if the following blog would help in your scenario:

https://powerapps.microsoft.com/en-us/blog/default-values-for-complex-sharepoint-types/

 

Best regards,

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.

View solution in original post

Highlighted

That's perfect thank you! Yes, I'm using ClearCollect, it was the instruction for this that did the trick:

 

Set the DefaultSelectedItems property of the ComboBox to following:

{
    ColumnName:  ThisItem.'Size Pricked'   /* <-- ColumnName represents the column from your collection, which you displayed within the ComboBox */
}

I'm using a SP list, so putting in the column name has solved the problem.

 

You've saved me so much time - thank you.

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Top Solution Authors
Top Kudoed Authors
Users online (10,785)