web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Set ComboBox DefaultSe...
Power Apps
Answered

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

(0) ShareShare
ReportReport
Posted on by 8

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

Categories:
I have the same question (0)
  • Verified answer
    v-yuxima-msft Profile Picture
    on at

    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

     

     

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 721 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 320 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard