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 😄
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.
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.
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
WarrenBelz
146,660
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
66,004
Most Valuable Professional