cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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
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
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
thirdimage

Power Apps Super User Class of 2020

Check it out!

thirdimage

New Badges

Check it out!

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors
Users online (6,325)