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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Remove button error
Power Apps
Unanswered

Remove button error

(0) ShareShare
ReportReport
Posted on by 10

Good day

I am having issues with the remove button. I have a global variable where I store my table and when I  want to delete a record from that table the remove function tells me that my first element is not a collection. I have a form where I can edit my table and this works very good but when I want to delete a record it doesn't work.

Thanks.

Categories:
I have the same question (0)
  • RandyHayes Profile Picture
    76,297 Super User 2024 Season 1 on at

    @DavidDiaz 

    You cannot remove records from a table variable.  The only feature in PowerApps that gives you that type of Add or Remove of records directly is a collection.

     

    However, you can easily continue to use a variable, you just have to not use the Remove and RemoveIf functions on it.

    ex.

        Set(yourTableVar, Filter(yourTableVar, !(ID = 10)))

    This will result in removing the record with the ID of 10 (for example).

     

    I hope this is helpful for you.

  • DavidDiaz Profile Picture
    10 on at

    I understand. But the function does remove the record? because I'm just changing the variable.

  • RandyHayes Profile Picture
    76,297 Super User 2024 Season 1 on at

    @DavidDiaz 

    What do you mean by removing the record specifically?  Your variable is a Table of records.  If you want to remove a specific (or several) records from the table variable, then the formula I provided will do exactly that.  The reason is that the Filter function returns a table.  So, in the example, you are filtering your table variable for all records except ID=10.  So the resulting table from Filter is a table without that record.  In order to change ANY variable, you need to assign something different to it.  In the example, we changed the variable to be the results of the Filter. 

     

    If you are trying to remove a record from some other datasource, that is different.

  • DavidDiaz Profile Picture
    10 on at

    I understand and now I know what is happening. I have an excel sheet table as data source,i had to create a new column as id and the function that you gave me is not showing error but is not working because is not updating my excel sheet without the row i want to delete,do you know how i can fix this?

  • RandyHayes Profile Picture
    76,297 Super User 2024 Season 1 on at

    @DavidDiaz 

    Yes, what you initially asked for was how to remove a row from a variable that contains a table.

    That is not going to update any datasource like Excel, it is only going to remove the record from a table in a variable.

     

    What and why are you using a variable if you want to work with the datasource?  I am not understanding your scenario. 

  • DavidDiaz Profile Picture
    10 on at

    I have 30 diferent tables as data source in the same excel sheet. Then i want to edit one of them so i use a variable to store the table and a form that use that variable as a source. This is working well,i can add and edit a the records of each table but i can not delete any of them because what i told you,so i dont know if i am not understanding or what is happening.

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 840 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 332 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 275

Last 30 days Overall leaderboard