Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Suggested answer

Can't get ComboBox DefaultSelectedItems to work

(2) ShareShare
ReportReport
Posted on by 28
I have this Named Formula:
IdeaBenefits = ["","Montary Benefits","Customer Service","Improved Morale","Improvement of Organizational Communication","Safety/Health","Working Conditions","Improve Consumer Outcomes","Process Improvement","Product Improvement","Reduce Paperwork","Other"];
The ComboBox Items property is set to:
IdeaBenefits
The ComboBox DefaultSelectedItems property is set to:
 
If(
    IdeaFormEdit,
    Filter(
        IdeaBenefits,
        Value in Split('List Ideas Gallery'.Selected.'Potential Benefits', ";")
    ),
    []
)
 
(Each "Idea" can have multiple benefits so this is a multi-select ComboBox)
 
All the other controls are working perfectly, just the one ComboBox is not. Nothing becomes selected when it should be.
 
For an example, when I put 'Potential Benefits' into a simple text label for a particular Idea, it shows "Montary Benefits#;Customer Service#;Improved Morale#;" (idk why the last dev added the hashes, I did try adding that in the split delimiter but it still didn't work.
 
Any ideas?
Categories:
  • HJ-23070237-0 Profile Picture
    28 on at
    Can't get ComboBox DefaultSelectedItems to work
  • HJ-23070237-0 Profile Picture
    28 on at
    Can't get ComboBox DefaultSelectedItems to work
    Thanks for the reply Michael. With this new horrible forum I hope you see my response, I can't tag you or reply to your comment.
     
    So I selected an idea in the gallery and the put "'List Ideas Gallery'.Selected.'Potential Benefits'" in a textbox and it gave me "Montary Benefits#;Customer Service#;Improved Morale#;"
     
    As per your suggestion, I added a combo box and made the Items property "Split('List Ideas Gallery'.Selected.'Potential Benefits', "#;")" and then it did correctly show the items that were selected for that selected Idea.

    However in that new ComboBox if I set DefaultSelectedItems also to "Split('List Ideas Gallery'.Selected.'Potential Benefits', "#;")", it still is selecting nothing, even though we now know that formula is returning valid results.

    Using concat changed nothing.
     
    Edit:
    @Michael E. Gernaey
    It let me tag this time
  • Suggested answer
    Michael E. Gernaey Profile Picture
    43,177 Super User 2025 Season 1 on at
    Can't get ComboBox DefaultSelectedItems to work
     
    Since we cannot see what the value of 'List Ideas Gallery'.Selected.'Potential Benefits' is, its easy to say thats the issue but let's take it further
     
    Add a second gallery or a list or a combobox I dont care
    Assuming that 'List Ideas Gallery'.Selected.'Potential Benefits' produces a collection of Strings, again strings, if you just put your split function in its items property what do you get back?
     
    Next,
     
    I'm not sure I would have used a named formula for essentially a collection but hey :-) thats up to you, but thats just me.
     
    Or
     
    instead of doing your split you could do concat which will just create a string, and then the in fill find it assuming Value is coming out what you want (meaning) the individual items in IdeaBenefits
     
    So that you are checking the string alone versus trying to do essentially a contains for an array of things you get back.
     
    If(
        IdeaFormEdit,
        Filter(
            IdeaBenefits,
            Value in Concat('List Ideas Gallery'.Selected.'Potential Benefits', Value & "")
        ),
        []
    )
     
     

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

Michael Gernaey – Community Spotlight

We are honored to recognize Michael Gernaey as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard >