cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
MarcBailey
Resolver II
Resolver II

Can you DropColumns from a Collection

Is it possible to DropColumns from a Collection.

 

I am using the following code for collection named CollectNewProjectAcct and it is not working:

 

DropColumns(CollectNewProjectAcct, "SourceMatchName2")

 

Thanks, Marc...

1 ACCEPTED SOLUTION

Accepted Solutions
timl
Super User
Super User

Hi Marc,

I think the confusion here is that DropColumns doesn't actually remove or delete columns from a data source. Instead, it returns a new collection that excludes the columns that you specify. For instance, if you were to set the data source property of a gallery control to the formula that you mention, you'll hopefully find that the gallery control doesn't show the SourceMatchName2 column.

To carry out what I think you want to do, you could collect the result from DropColumns into a new collection like so:

 

ClearCollect(CollectNewProjectAcct2, DropColumns(CollectNewProjectAcct, "SourceMatchName2"))

Alternatively, you could try to collect it into your existing CollectNewProjectAcct collection.

Hope that helps a bit.

View solution in original post

2 REPLIES 2
timl
Super User
Super User

Hi Marc,

I think the confusion here is that DropColumns doesn't actually remove or delete columns from a data source. Instead, it returns a new collection that excludes the columns that you specify. For instance, if you were to set the data source property of a gallery control to the formula that you mention, you'll hopefully find that the gallery control doesn't show the SourceMatchName2 column.

To carry out what I think you want to do, you could collect the result from DropColumns into a new collection like so:

 

ClearCollect(CollectNewProjectAcct2, DropColumns(CollectNewProjectAcct, "SourceMatchName2"))

Alternatively, you could try to collect it into your existing CollectNewProjectAcct collection.

Hope that helps a bit.

Timl,

 

Thanks for the reply - that will take care of what I need...

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (3,074)