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 / Combobox only has 1 it...
Power Apps
Unanswered

Combobox only has 1 item: DefaultSelectedItems make it select that item

(1) ShareShare
ReportReport
Posted on by 818

So I have several Comboboxes that have their items populated like so:

Table({Value: IfError(Index(Split(DataCardValue2.Text; " "); 1).Value; "")})

Meaning, theres a Textinput that the user will put a lot of numbers, separated by a space. Example: user inputs into DataCardValue2 "123 1234 12345", so Comboboxes 1 2 and 3 should have a single item of "123" "1234" "12345", respectively.

I need to edit the DefaultSelectedItems property of all of these databoxes so that each selects the singular first item they have. 

How can I edit that property to make it so?

Ty in advance 😄

Categories:
I have the same question (0)
  • Verified answer
    ANB Profile Picture
    7,223 Super User 2025 Season 2 on at

    Hi @WorkingRicardo , Try this: 

    {Value: First(Split(DataCardValue2.Text; " "))}

    -----------------------------------------------------------------------------------------------------------------------------

    I hope this helps.

    Please click Accept as solution ✅ if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs up.👍

    Thanks,
    ANB


  • Verified answer
    SidJohri Profile Picture
    24 on at

    Hi @WorkingRicardo ,

     

    Trying to refer to a combox's Items property in its own DefaultSelectedItems property would create a circular reference which Power Apps will not allow. So, what you'll want to do is essentially repeat the Items property formula in the DefaultSelectedItems property and take the First() item from the table.

     

    Combobox1.DefaultSelectedItems = First(Table({Value: IfError(Index(Split(DataCardValue2.Text; " "); 1).Value; "")}))

    Combobox2.DefaultSelectedItems = First(Table({Value: IfError(Index(Split(DataCardValue2.Text; " "); 2).Value; "")}))

    etc.

     

    As an aside, what is the use case for a combobox to display a single item. Why not simply use a label to do so?

     

    Hope this helps,

      -- Sid.

     

    ---------

    Please click Accept as solution if my post solved your issue. This will help others find it more easily. If my solution was helpful in other ways, please consider giving it a Thumbs Up.

     

  • WorkingRicardo Profile Picture
    818 on at

    Hey @SidJohri and @ANB 

    Thank you for your replies! Both solutions worked for me. So I'll chose any of those randomly haha (didn't get the delegation problem)

    This is the only way I figured out how to block text to be copied from my app. As we want users to be able to access the info, but at least make it hard for them to extract data. With text labels, even if adding a transparent rectangle, you can still copy Textlabel content with Ctr+A (select all). Selected items in combobox bypasses the Ctr+A. 

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