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
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
New Ranks and Rank Icons in April

'New Ranks and Rank Icons in April

Read the announcement for more information!

Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (4,808)