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 / Collect() adds extra b...
Power Apps
Suggested Answer

Collect() adds extra blank row after the proper row

(0) ShareShare
ReportReport
Posted on by 8
I have a combo box where I am search office 365 users, then OnChange I am adding the user to a collection. This is working except that it adds an extra row after each one
 
 
Collect(

    colGroupMembers,

    {

        Name: Trim(cboGroupMembers.Selected.DisplayName),

        Email: Trim(cboGroupMembers.Selected.Mail)

    }

);

Reset(cboGroupMembers)

 

Search Code for combo box:

 

Office365Users.SearchUserV2({searchTerm:Self.SearchText,isSearchTermRequired:true,top:15}).value
 
I have the same question (0)
  • FunkyStuntMunky Profile Picture
    8 on at
    after more testing, it appears it is due to the reset(cbogroupMembers) command. Is there a way to reset the search without triggering an OnChange event?
  • Suggested answer
    FunkyStuntMunky Profile Picture
    8 on at
    OK answered my own question. Just checked the length of the item before running the Collect()
     
    If(
    
        Len(cboSearchUsers.Selected.DisplayName) > 1,
    
        Collect(
    
            colGroupMembers,
    
            {
    
                Name: cboSearchUsers.Selected.DisplayName,
    
                Email: cboSearchUsers.Selected.Mail
    
            }
    
        )
    
    );
    
    Reset(cboSearchUsers)
     
  • Suggested answer
    CNT Profile Picture
    10,921 Super User 2024 Season 1 on at
    The correct way to do is to use the OnSelect property and not the OnChange property.
     
    Please remember to give a like👍and mark this reply Answered as it will help others in the future.
     
  • Suggested answer
    Ram Prakash Duraisamy Profile Picture
    5,877 Super User 2026 Season 1 on at
    Hi,
     
    Instead of Collect use Clear Collect
     

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

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 335 Most Valuable Professional

#2
11manish Profile Picture

11manish 165

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 96 Super User 2026 Season 1

Last 30 days Overall leaderboard