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 default value of a...
Power Apps
Unanswered

Set default value of a combo box linked to a choices sharepoint column

(1) ShareShare
ReportReport
Posted on by 179

I have a combo box that is linked to a sharepoint choices column (only one value selectable) and I want to set the default selected to a specific value but cannot work out how to do it. I'm assuming it is the 'Default Selected Items' field that I need to update.

  • The sharepoint list is called 'Find A mentor' 
  • The choice column is called 'Current Capacity?'
  • The default choice I want to include is Yes (The choices available are Yes, No or Unknown) 

Any help appreciated

 

Below was my attempt that does not work

Choices('Find a Mentor'.'Current Capacity?' = 'Yes')

 

 

Categories:
I have the same question (0)
  • NandiniBhagya20 Profile Picture
    4,667 Super User 2024 Season 1 on at

    Hi @ChrisUndery ,
    Use below in DefaultSelectedItems property - 
    {Value: "Yes"}


  • RJM07 Profile Picture
    801 on at

    If there's only 3 choices, you might have more luck with a dropdown?

  • Anchov Profile Picture
    1,986 on at

    This should be your Default Selected Items property:

    {Value: "Yes"}

    If I have answered your question, please mark your post as Solved.
    If you like my response, please give it a Thumbs Up.

    Cheers!
    Rick Hurt

  • ChrisUndery Profile Picture
    179 on at

    Thanks all. That works for the default but I have a 'reset' button currently set to the below. This resets it ot the default that is now 'Yes' but I actually want it to set to nothing selected if its clicked on. What code do I need to use against the OnSelect value of the icon?

    Reset(ComboBox4_Capacity)

     

    ChrisUndery_0-1681745879964.png

     

  • Anchov Profile Picture
    1,986 on at

    one way to solve:

    One reset icon Onselect:

    UpdateContext({varLocalSetBlank: true}) 

    One DefaultSelectedItems:

    If(varLocalSetBlank, {Value: Blank()}, {Value: "Yes"})

     

  • RJM07 Profile Picture
    801 on at

    You'd need to do

    UpdateContext({varLocalSetBlank: false});
    UpdateContext({varLocalSetBlank: true});

    I found it didn't work otherwise, I used it for a datepicker, It didn't work because it had nothing to update as the context was always set to true, you have to make it false before you can update it to true

  • ChrisUndery Profile Picture
    179 on at

    Thank you @Anchov & @RJM07 

    Using either of those, the reset button removes the entry from the combo box but it does something weird to the gallery view that the combo box filters. Rather than showing all entries when its reset, it shows none.

    Weirdly it also doesn't update the Filter(s) applied visual which implies its not really empty??

    Any ideas?

    ChrisUndery_0-1681821199434.png 

    ChrisUndery_1-1681821223571.png

     

    Filter applied visual code

    If(IsBlank(ComboBox4_AreasSupported) && IsBlank(ComboBox4_Characteristics) && IsBlank(ComboBox4_CliftonStrengths) && IsBlank(txtInput_Search) && IsBlank(txtInput_Search_Name) && IsBlank(ComboBox4_Initiatives) && IsBlank(ComboBox4_Capacity) ,Icon.FilterFlat,Icon.FilterFlatFilled) 

    Gallery 'Items' code

    Sort(
     Search(
     AddColumns(
     Search(
     Filter(
     'Find a Mentor',
     And(
     Or(
     IsBlank(ComboBox4_Characteristics.SelectedItems),
     IsEmpty(ComboBox4_Characteristics.SelectedItems),
     !(false in ForAll(
     ComboBox4_Characteristics.SelectedItems,
     ThisRecord.Value in 'Top 5 mentor characteristics'.Value
     ))
     ),
     Or(
     IsBlank(ComboBox4_AreasSupported.SelectedItems),
     IsEmpty(ComboBox4_AreasSupported.SelectedItems),
     !(false in ForAll(
     ComboBox4_AreasSupported.SelectedItems,
     ThisRecord.Value in 'Areas Supported'.Value
     ))
     ),
     Or(
     IsBlank(ComboBox4_CliftonStrengths.SelectedItems),
     IsEmpty(ComboBox4_CliftonStrengths.SelectedItems),
     !(false in ForAll(
     ComboBox4_CliftonStrengths.SelectedItems,
     ThisRecord.Value in 'Top 5 Clifton Strengths'.Value
     ))
     ),
     Or(
     IsBlank(ComboBox4_Capacity.SelectedItems),
     IsEmpty(ComboBox4_Capacity.SelectedItems),
     'Current Capacity?'.Value in ComboBox4_Capacity.SelectedItems.Value
     ),
     Or(
     IsBlank(ComboBox4_Initiatives.SelectedItems),
     IsEmpty(ComboBox4_Initiatives.SelectedItems),
     'Initiatives supported'.Value in ComboBox4_Initiatives.SelectedItems.Value
     )
     )
     ),
     txtInput_Search.Text,
     "AboutyouasaMentor"
     ),
     "MentorName",
     'Mentor Name'.DisplayName
     ),
     txtInput_Search_Name.Text,
     "MentorName"
     ),
     MentorName
    )

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 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard