Updating a CSV from DataGridView value

My goal is to read a DataGridView object containing text out of a proprietary desktop application and output its value on a regular interval for a downstream process (in a different application) to read. When the user, or the program switches the DataGridView obejct, the output would change accordingly. For now, I’ve been testing this by appending the text to a CSV file.

I’ve been using a while loop to process this, and my CSV file is in fact updated. However, when I change the DataGridView object, UiPath continues to append the old text value to the CSV file.

Any help would be greatly appreciated!

Does it append old text value+new text value? if so after “append to CSV” give a “clear data table” activity in that data table name as ExtractDataTable and try.

The program was actually just appending another row to the CSV, so the longer it runs the more CSV lines the file would have. So, the text was not being overwritten.

I tried adding a “Clear Data Table” step within the while loop after the text is appended. Unfortunately, this did not change the result.