CHECK IF TXT IS EMPTY

How do I check if the txt is empty? and if it is empty, write the records in the txt. And if it is not empty, empty it and write the records in the txt

image
As it currently stands, what it does is add lines to the txt. I want the TXT to be the result of the flow.
Therefore it should be deleted if it exists previously

@mateo_marquez

Add a delete file before for loop…so that the file is always created as new…

Append line will create the file if it does not exists so first time it creates and subsequent looping will be appended

Cheers

1 Like

Hi @mateo_marquez

->use read text file activity and store it in a string variable say text_Out
->use if activity the condition would be String.IsNullOrEmpty(text_Out)
if the condition turns to be true then delete that file.

Regards,

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