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

Set ComboBox DefaultSelectedItems to all distinct choices if first item in the list equals a specific value

Hi,

 

I have a ComboBox where the user can select 1 or multiple choices. The choices are stored in a SharePoint choices list called 'Attributes List'. When the app first loads, it checks the first record in the list. If the first value under the 'Key Skills' column is equal to 'Any Skills', the DefaultSelectedItems for the ComboBox are to be set to all available choices. However, if the first value under this column is anything else, only that one value is to be set as the DefaultSelectedItem.

 

Here is the code I am using in the ComboBox DefaultSelectedItems property:

If(LookUp('Attributes List', ID=1,'Key Skills'="Any Skill"),Choices('Attributes List'.'Key Skills'), LookUp('Attributes List', ID=1,'Key Skills'))

 

The error I am experiencing is an invalid argument type which occurs with the 'Key Skills'="Any Skill" as shown in Capture1.

 

I'm not sure how to get around this, any help would be appreciated.

 

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Set ComboBox DefaultSelectedItems to all distinct choices if first item in the list equals a specific value

Hi @Braden 

 

Could you please change your formula expression as this?

If(First(Choices('SPListName'.ChoiceColumnName)).Value="DefaultItem",Choices('SPListName'.ChoiceColumnName),First(Choices('SPListName'.ChoiceColumnName)))   

 

 

If(First(Choices('2019test'.Key_Skills)).Value="Any_Skills",Choices('2019test'.Key_Skills),First(Choices('2019test'.Key_Skills)))       

(the green color ones are my SP list name,Choice column Name on my side, you can change to yours on your side)

Choices1.PNG

 

Hope this could be helpful.

 

Best Regards.

Yumia

 

 

 

View solution in original post

1 REPLY 1
Community Support Team
Community Support Team

Re: Set ComboBox DefaultSelectedItems to all distinct choices if first item in the list equals a specific value

Hi @Braden 

 

Could you please change your formula expression as this?

If(First(Choices('SPListName'.ChoiceColumnName)).Value="DefaultItem",Choices('SPListName'.ChoiceColumnName),First(Choices('SPListName'.ChoiceColumnName)))   

 

 

If(First(Choices('2019test'.Key_Skills)).Value="Any_Skills",Choices('2019test'.Key_Skills),First(Choices('2019test'.Key_Skills)))       

(the green color ones are my SP list name,Choice column Name on my side, you can change to yours on your side)

Choices1.PNG

 

Hope this could be helpful.

 

Best Regards.

Yumia

 

 

 

View solution in original post

Helpful resources

Announcements
thirdimage

Power Apps Super User Class of 2020

Check it out!

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors (Last 30 Days)
Users online (4,627)