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 / Best way to clear/empt...
Power Apps
Unanswered

Best way to clear/empty Data Table

(0) ShareShare
ReportReport
Posted on by 29

Hi,

I have a button that gets data from the form and it makes some calculations & produces a set of rows and then patches multiple rows to Dataverse. If the patch is successful, I load the data into a Datatable on the form for the user to view what they just submitted.

I set the filter value for the data table using a variable on the button that does the Patch, this value is one of the textboxes on the form (ItemID)

Now I'm trying to put a clear button on the form to clear this datatable but I'm struggling to do this. I tried setting this filter variable to Blank() when the clear button is pressed, however this breaks the data loading to the datatable... And I'm wondering if I'm doing this in the wrong way.

What is the best way to clear a data table?

 

thanks

 

Categories:
I have the same question (0)
  • AVTS Profile Picture
    538 on at

     

     

    Insert a Button with:

     

    Clear(colTable)

     

     

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

    @powerbug 

    Can you provide more details on your app (screenshots) including the controls in the screen as well as any formulas you currently are using that are not working?

     

  • powerbug Profile Picture
    29 on at

    this doesn't work for the data table.

    Invalid argument type (Control)  Expecting a Table value instead

  • powerbug Profile Picture
    29 on at

    I'm afraid I can't share screenshots as it's confidential (even the names of controls)
    All I want to do is empty a datatable on the form by pressing a button and struggling to do this 

  • VJR Profile Picture
    7,635 on at

    Lets say your current source of data is called TableWithData

    Maybe have another Table called as EmptyTable with the same columns as TableWithData which will always be blank with only headers.

    Use IF formula on the Datatable Items property, such that when you want to show empty records show EmptyTable, else TableWithData.

     

     

    Edit: just to clarify, TableWithData and EmptyTable are Excel tables as an example. In your case could be something else.

  • AVTS Profile Picture
    538 on at

    How about trying with flows ?

     

     

    AVTS_0-1660650504805.png

     

     

     

  • powerbug Profile Picture
    29 on at

    Data table is a form control - so how could you empty it on runtime with flow, I'm confused. I'm talking about database tables

  • AVTS Profile Picture
    538 on at

    Hi Power to reproduce your issue we need to have the more details of your app as mentioned by RandyHayes.

     

    Thank you . 

  • powerbug Profile Picture
    29 on at

    Let me explain in detail


    I have a form, which takes some data from user. Then it makes a calculation, produces some rows and saves to database. 
    The user wants to see what is  inserted, so I load all these to a data table on the form, called AddedRows
    The Items property on AddedRows has this Filter('TABLE NAME',Field1=filter)
    Filter is a variable I set on the button that adds rows to database
    there's a ClearInput button. that clears the values on the form. I want this to clear the datatable as well. however when I update Filter in this button onclick it makes it mess up next time I load the table



  • misco007 Profile Picture
    5 on at

    I have the same issue, any help?

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 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard