web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Delete column from col...
Power Apps
Unanswered

Delete column from collection

(0) ShareShare
ReportReport
Posted on by 105

I have a gallery with checkbox, oncheck the app collect the items from the gallery in a collection named colBooking. 

In my gallery, with the AddColumn function, I added a column "SEARCHID" for searching the ID in a textbox.

My current problem is that for the purpose of the colBooking collection I need it not to collect the "SearchID" column.

 

Do you have any ideas on how to fix it?

 

I also tried to collect the columns individually like this:

Collect(colBooking;ThisItem.column1;ThisItem.column2;ThisItem.column3)

but I don't know what to add to the OnUncheck property to remove the record if the user unchecks the checkbox.

 

I hope I explained myself better. If so, I'm available for other explanations.

 

Categories:
  • DavidZoon Profile Picture
    738 Most Valuable Professional on at

    Hello,

     

    You can use formula DropColumns() in your collect(), in the same way you used AddColumns() in your gallery source , it'll make the schema of your column liket before you added the column SEARCHID

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily.

  • roby9390 Profile Picture
    105 on at

    Hi @DavidZoon  and thanks for your reply.

    I had already tried it but it's not clear to me where to put the dropcolumn function.

     

    Now the OnCheck property of my checkbox is as follow:

    Collect(colBooking;ThisItem)

    How should I change it?

     

    thank you for your support

  • DavidZoon Profile Picture
    738 Most Valuable Professional on at

    Logically, if the column is added in the Items of the gallery, you will have to drop the added column when you are going to request the data in this same gallery.
    The following syntax should work:

     

    Collect(colBooking;DropColumns(ThisItem,"IDSEARCH"))

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily.

  • roby9390 Profile Picture
    105 on at

    If I use the syntax you indicated near "ThisItem" I get an error: "The type of argument is not valid (record): a table value is expected."

     

    How can I solve it?

  • DavidZoon Profile Picture
    738 Most Valuable Professional on at

    My bad, DropColmuns don't work with column, you have to convert it to table and get de first item when colmun is dropped : 

     

    Collect(colBooking;First(DropColumns(Table(ThisItem),"IDSEARCH"))

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 405 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 368

#3
WarrenBelz Profile Picture

WarrenBelz 244 Most Valuable Professional

Last 30 days Overall leaderboard