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
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
MBAS Gallery 2020

MBAS Gallery 2020

Watch Microsoft Business Applications Summit sessions on-demand.

firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Apps Community!

Top Solution Authors
Top Kudoed Authors
Users online (5,369)