cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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
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
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

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
New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

Top Solution Authors
Top Kudoed Authors
Users online (14,488)