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 / Combo box selection le...
Power Apps
Answered

Combo box selection length

(0) ShareShare
ReportReport
Posted on by 73

Hi I'm trying to check the length of the selected item, I'm trying len(datacardvalue7.selecteditems)  but all I get is a redline error. Basically I want to check if the combobox selected item has a legth greater than 0. 

 

Any help is appreciated.

 

 

Categories:
  • Verified answer
    iAm_ManCat Profile Picture
    18,256 Most Valuable Professional on at

    Len() is for counting the number of elements within a single string, CountRows() is for counting how many items there are (i.e. how many items are selected). You are trying to determine if there is a valid item(s) selected.

     

    In your example, you are referencing .SelectedItems which is a multiple-item property

     

    You can either do the following for a singular selected item (assuming this is a single-select-only combobox)

    Len(datacardvalue7.Selected.Value) > 0

    (it may be another property than .Value)

     

     

    Or you can reference the number of selected items, but from your description it sounds like you want to check whether the selected item itself is valid rather than the number of selected items:

    CountRows(datacardvalue7.selecteditems) > 0

     

    Cheers,

    Sancho

     

  • WalesMariner Profile Picture
    73 on at

    Amazing Sancho thank you so much!

  • iAm_ManCat Profile Picture
    18,256 Most Valuable Professional on at

    Happy to help and share the knowledge 🙂

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 354 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 330

#3
Mohsin Ali Profile Picture

Mohsin Ali 232

Last 30 days Overall leaderboard