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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Collect() adds extra b...
Power Apps
Unanswered

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,593 Super User 2025 Season 2 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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard