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 III
Super User III

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 III
Super User III

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
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Top Solution Authors
Top Kudoed Authors
Users online (10,198)