Ganesh M
Ganesh M

Reputation: 27

How to Delete Multiple Rows in Power Apps Data Table

I have a Power Apps Data table and this data table retrieves my SharePoint list [Vacation Budget] records. I have already removed multiple records in the data table using the RemoveIf function based on the SharePoint list choice field value. But, my requirement is how to delete the last two rows or the middle of three rows in the Power Apps data table. Code is: enter image description here RemoveIf( 'Vacation Budget', Category.Value = "Entertainment" )

Please suggest any code for this requirement...

Upvotes: 0

Views: 1613

Answers (1)

Saravanan Mohandas
Saravanan Mohandas

Reputation: 1

First, count the number of entries in the "Vacation Budget" where the category value is "Entertainment":

1.Declare a variable NoOfData and set it to the count of rows with the category value "Entertainment":

Set(NoOfData,
    CountRows(
        Filter(
            'Vacation Budget',
            Category.Value = "Entertainment"
        )
    )
);

2.Then, use the Sequence and ForAll methods to remove those entries:

ForAll(
    Sequence(NoOfData),
    RemoveIf('Vacation Budget', Category.Value = "Entertainment")
);

Upvotes: 0

Related Questions