Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Power Apps Pro Dev & ISV
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
 
  • Suggested answer
    Ram Prakash Profile Picture
    5,284 Super User 2025 Season 1 on at
    Collect() adds extra blank row after the proper row
    Hi,
     
    Instead of Collect use Clear Collect
     
  • Suggested answer
    CNT Profile Picture
    10,919 Super User 2025 Season 1 on at
    Collect() adds extra blank row after the proper row
    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
    FunkyStuntMunky Profile Picture
    8 on at
    Collect() adds extra blank row after the proper row
    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)
     
  • FunkyStuntMunky Profile Picture
    8 on at
    Collect() adds extra blank row after the proper row
    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?

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

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 791 Most Valuable Professional

#2
MS.Ragavendar Profile Picture

MS.Ragavendar 410

#3
mmbr1606 Profile Picture

mmbr1606 275 Super User 2025 Season 1