Reset the Data Grid on a button click in UiPath forms


I am working on UiPath forms where the requirement is to click on a form and it should delete every data from the forms (Data grid & textboxes). I cannot use reset button here because I need to perform some activity first by clicking on the same button and then same button should reset the whole form data.

Any suggestions or workaround for this please?

@supermanPunch @Palaniyappan @Parth_Doshi

Any suggestion please

Hi @Happy_Coding ,

We need to understand at what point is the reset to be done ?

Also, When you mentioned it should delete all form Data, Meaning should it delete from every type of component the values are filled in ?

I am extracting some values from a web application and filling inside form component.

For Example : There are two text fields which are filled when the user clicks on “Extract data” button. There is a data grid as well in this form which gets populated by some other buttons.

The requirement is when the user again click on “Submit” button it should clear the whole form data . (It is not clearing the data grid ).

Is your data grid an in argument or in/out

It is an In/Out argument @Parth_Doshi

@Happy_Coding I was able to reset the data grid. Please check the attached workflow. (3.7 KB)

Let me know if you have any questions.

@Happy_Coding ,

From this can we assume that it is clearing the text fields but not the Data Grid ? Also, What was done for Clearing the Text fields ? Was there a separate logic introduced for that ?

Thanks for responding.

However I tried this earlier , It is clearing the rows but when we are trying to perform any other operations in the form its not working after clearing the form. Because the data table value has Nothing.

Use Invoke Code and then try to use Clear method of data table and see if it works or not.

I used below method :slight_smile:

In assign activity , I assigned the variable for textfields to “”
For data table also I have assigned the datatable to Nothing .

It is working but after doing this I am not able to perform any operations in the form further . since we have set datatable value to Nothing

@Happy_Coding ,

Maybe using dtData.Clone would help resolve it ?

Did you try with Invoke Code? @Happy_Coding

No , I didn’t .

having less idea about the invoke code . So couldn’t try .

Do you have something same with invoke code ? It would be really helpful (3.7 KB)
Try to use this workflow and see if it works.

1 Like

@Parth_Doshi , thanks a lot .

It worked for me.

much appreciated.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.