cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
jwim
Level: Powered On

ComboBox DefaultSelectedItems

I'm just unable to get this and it's driving me bonkers.

I've got a 3 screen Browse, Detail and Edit App. I've replaced a significant number of the dropdowns with comboboxes in the edit screen datacards to allow for blank defaults, better filtering and easier waterfall selections. Everything works great EXCEPT moving from the Detail screen to the Edit Screen. I cannot for the life of me get the selected gallery record to default in the comboboxes on the edit screen. The issue I thought came down to Data type, where I have text, but the function shows me what the value or text should be.

DefaultSelectedItems1.PNG

If i just use Selected, it comes through but it pulls from column A (site name) regardless of which combobox i add it too.

 

I then tried to use AllItems instead of Selected, which gives me a data type of table with the correct selected item in the funciton preview, but nothing shows up in the combo box.

DefaultSelectedItems2.PNG

 

So then I looked at the text fields that are coming through from the Detail Screen (Project Name Field), which has a default DataCard of ThisItem.ProjectName and default DataCardValue of If(EditForm1.Mode = FormMode.Edit,Parent.Default,""). Try to use this, but nope. Just blank!

 

My new form adds to my sharepoint list correctly,  but can't edit already created rows inside of the app because of this issue. ANY HELP MUCH APPRECIATED.

 

Jason

1 REPLY 1
Community Support Team
Community Support Team

Re: ComboBox DefaultSelectedItems

Hi @jwim ,

Could you please share a bit more about the SBU column in your SP List? Is it a Single text type column or Choice type column?

Do you want to set the selected value within the ComboBox as Display value when you edit an record?

 

1. If the SBU column in your SP List is a Single text type column:

Set the DefaultSelectedItems property of the ComboBox to following:

If(
   EditForm1.Mode = FormMode.New,
   {
     Value: Parent.Default
   },
   {
      Value: BrowseGallery1_1.Selected.SBU
   }
)

 

2. If the SBU column in your SP List is a Choice type column:

Set the DefaultSelectedItems property of the ComboBox to following:

If(
   EditForm1.Mode = FormMode.New,
   Parent.Default,
   {
      Value: BrowseGallery1_1.Selected.SBU.Value
   }
)

Please also make sure the SelectMultiple property of the ComboBox to false.

 

In addition, if you set the Items property of the SBU ComboBox to following similar formula:

Distinct(...)

Please modify above formula as below:

If(                                          /* <-- SBU is Single text type column */
   EditForm1.Mode = FormMode.New,
   {
     Result: Parent.Default
   },
   {
      Result: BrowseGallery1_1.Selected.SBU
   }
)
If(                                   /* <-- The SBU is Choice type column */
   EditForm1.Mode = FormMode.New,
   {
Result: Parent.Default.Value
}, { Result: BrowseGallery1_1.Selected.SBU.Value } )

 

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.

Helpful resources

Announcements
firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

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

Top Kudoed Authors
Users Online
Currently online: 72 members 3,471 guests
Recent signins:
Please welcome our newest community members: