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 / Issue pulling collecti...
Power Apps
Answered

Issue pulling collection data

(0) ShareShare
ReportReport
Posted on by 28

Hey all, I'm noticing some odd behavior when trying to pull info from a SharePoint list connected gallery into a collection. The SP list contains contacts. The columns are Employee ID, Last Name, First Name, Group, Status and Cell phone number. Right now there are only 72 rows. I'm trying to create collections based on whether or not a user is a Field employee or Office employee. Users check a checkbox and the oncheck is set to:

 

 

ForAll(Gallery_Contacts.AllItems, 
 If((TI_Group.Text = "Field"),
 Collect(FieldCellNumber, {Employee: TI_LastName.Text & ", " & TI_FirstName.Text, Cell: TI_Cell.Text })
 ))

 

 

 

The problem I am running into is that the Collection doesn't full populate. It seems to get part way through the gallery before it stops collecting data. There have been a few times where I was able to get it to fully populate after refreshing the data source several times, but that won't really fly when I want to publish this. Am I making a mistake in the Collect portion or should I be doing this some other way?

incomplete collection.png
checkbox.png
collect.png
Categories:
I have the same question (0)
  • v-yutliu-msft Profile Picture
    Microsoft Employee on at

    Hi @lokdawg78 ,

    Could you tell me what is TI_Group?

    Is it a group name or the check box for Field's name?

    Actually, we not use Checkboxname.Text to justify whether a check box is checked. We use checkboxname.Value to check.

    If the check box 's Value is true, then it is checked.

    If the check box 's Value is false, then it is unchecked.

     

    If TI_Group  is the check box for Field's name, try this:

    1)set Field check box's OnCheck:

    ForAll(Gallery_Contacts.AllItems, 
     If(TI_Group.Value,
     Collect(FieldCellNumber, {Employee: TI_LastName.Text & ", " & TI_FirstName.Text, Cell: TI_Cell.Text })
     ))

     2)set Office check box's OnCheck:

    ForAll(Gallery_Contacts.AllItems, 
     If(officecheckboxname.Value,
     Collect(OfficeCellNumber, {Employee: TI_LastName.Text & ", " & TI_FirstName.Text, Cell: TI_Cell.Text })
     ))

     

    What's more, the data in collection is just a kind of temporary data. It will clear all the data automatically every time you shut down the app.

    You could set the app's OnStart to create collection every time you start the app.

     

     

    Best regards,

  • Verified answer
    lokdawg78 Profile Picture
    28 on at

    Thanks for the reply Phoebe. I was actually able to get it working by using Filter instead of ForAll. I have a gallery connected to a SharePoint list. The fields in the gallery are all text inputs for the SharePoint list columns.

    What I ended up doing was Filtering the SharePoint list with the OnStart for the app and just leaving the gallery for patching/editing the SharePoint list.

    ClearCollect(FieldCellNumber,
     ShowColumns(
     SortByColumns(
     Filter(Contacts, Group= "Field"),
     "Last_x0020_Name", Ascending
     ),
     "Last_x0020_Name",
     "First_x0020_Name",
     "Cell_x0023_",
     "Group"
     )
    );

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 July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 427 Most Valuable Professional

#2
11manish Profile Picture

11manish 201 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 128 Super User 2026 Season 2

Last 30 days Overall leaderboard