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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Default selection for ...
Power Apps
Answered

Default selection for combo box connected to collection made from sharepoint?

(0) ShareShare
ReportReport
Posted on by 47

I'm having trouble selecting the default item for a single select, searchable combo box. It is connected to a collection "MARGINS" made by the collect of a sharepoint list. I'm hoping to set the default selection to the second item on the list, "40%". I cant figure out the code or if it should be in default or default selected items. 

 

This is the items code for the combo box:

Sort(ForAll(Distinct(MARGINS,Margin), {Result: ThisRecord.Value}),Result,SortOrder.Descending)
 
Thank you!
microhelp.PNG
Categories:
  • Verified answer
    WarrenBelz Profile Picture
    156,536 Most Valuable Professional on at

    HI @wiranqa ,

    Your Items can be (the Result syntax was only to address a legacy output change some time back)

    Sort(
     Distinct(
     MARGINS,
     Margin
     ),
     Value,
     SortOrder.Descending
    )

    If you simply want "40%" as the default, the DefaultSelectedItems would be

    {Value: "40%}

    If you want the second item (whatever it is) as the default

    {
     Value:
     Index(
     Sort(
     Distinct(
     MARGINS,
     Margin
     ),
     Value,
     SortOrder.Descending
     ),
     2
     ).Value
    }
    

     

    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.

    MVP (Business Applications)   Visit my blog Practical Power Apps

  • wiranqa Profile Picture
    47 on at

    I am making updates to a ~3 year old app! The second suggestion worked, now to remove a tonnnnn of "Selected.Result" elsewhere in the app...

    Thank you for your help!

  • WarrenBelz Profile Picture
    156,536 Most Valuable Professional on at

    Hi @wiranqa ,

    If you do not know this already, you can search for the word Result with the bottom icon in the left menu. I did mine as soon as the syntax change was rolled out.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 432 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 347

#3
WarrenBelz Profile Picture

WarrenBelz 254 Most Valuable Professional

Last 30 days Overall leaderboard