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
If you have a Table variable (varMyTable) and the table has a number of configured columns I have found the following works to clear the data from the table. I only had to set the first columns (Product) to Blank() for it to generate an empty table.
Set(varMyTable, Table( { Product: Blank() } ));
I have the same issue, any help?
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
Hi Power to reproduce your issue we need to have the more details of your app as mentioned by RandyHayes.
Thank you .
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
How about trying with flows ?
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.
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
this doesn't work for the data table.
Invalid argument type (Control) Expecting a Table value instead
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?
WarrenBelz
146,660
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
66,004
Most Valuable Professional