cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
sammybridge
Helper IV
Helper IV

Set Defaultselecteditems on a Combobox which is content type

Hello,

 

I am trying to use a button to set the defaultselecteditems to be one of the choices within my combobox. This works fine on all of my other comboboxes except for one. The one I am using is the content type choices from my datasources. Does anyone know how to fix this? Here are my screenshots.

 

Thanks

 

ButtonCode.PNG

ComboboxVariable.PNGComboBoxOptions.PNG

4 REPLIES 4
mdevaney
Super User III
Super User III

@sammybridge 

You didn't say which specific default values should show in the dropdown so I will give a general answer...

 

I think the problem is being caused by having 2 arguments in your Choices function.  Choices only accepts a single argument.

Set(contentvar, Choices('Accident & Incident Database'.'Content type', "Fire Report"))

 

You can supply only one argument, not both.

Set(contentvar, Choices('Accident & Incident Database'.'Content type'))
Set(contentvar, ["Fire Report"])

 

Also, make sure the MultipleSelect property is set to True if you want to allow more than one selection.

 

If this does not help, please provide more info.

 

---
Please click "Accept as Solution" if my response helped to solve your issue so that others may find it more quickly. If your thought the post was helpful please give it a "Thumbs Up."

Thank you. I was assuming that I had to reference the Choices of the SharePoint column before I told it which option to take but when I have tried to second option it looks to have worked.

 

Cheers

@mdevaney  on close inspection this hasn't worked. When the data passess to SharePoint it is always taking "Accident Record". When I use the Set in the form it looks fine but when I submit it always take the first value.

 

Do you think this is because I am using the content types rather than just a standard choices column?

@sammybridge 

Yes, I agree this is because you are using content types rather than a standard choices column.   Unfortunately, I am not familiar with working on SP content types in PowerApps. Cat Sad

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

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

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

Top Solution Authors
Top Kudoed Authors
Users online (66,311)