cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
LeonieW
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
v-xida-msft
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
v-xida-msft
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
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Power Apps June 2021

June Power Apps Community Call

Don't miss the call this month on June 16th - 8a PDT

Top Solution Authors
Top Kudoed Authors
Users online (61,397)