cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Anonymous
Not applicable

Loop for collection

Let us consider a table, the goal is to loop through it in order to retrieve all the elements containing a certain ID (inside the "ID" column). To make an analogy, the RemoveIf commands would suppress all the elements containing the specified ID, well here I'm looking for a sort of CollectIf, that would do the same, but instead of suppressing it would add.

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User
Super User

Re: Loop for collection

Hi @Anonymous 

Unless I misunderstand you, you can accomplish this by collecting the output of the Filter function.

ClearCollect(MyCollection,
             Filter(MyTable, IDColumn=1)
)

The function above will add all records from MyTable into a collection called MyCollection, where MyTable.IDColumn=1.

 

View solution in original post

1 REPLY 1
Highlighted
Super User
Super User

Re: Loop for collection

Hi @Anonymous 

Unless I misunderstand you, you can accomplish this by collecting the output of the Filter function.

ClearCollect(MyCollection,
             Filter(MyTable, IDColumn=1)
)

The function above will add all records from MyTable into a collection called MyCollection, where MyTable.IDColumn=1.

 

View solution in original post

Helpful resources

Announcements
secondImage

Demo-Extravaganza 2020

Check out these cool Power Apps & vote on your favorite!

secondImage

Community Highlights

Check out whats happening in Power Apps

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (8,735)