Write TXT fails when changing utf8-bom to utf8

Because when I set to invoke the method, to change the motod from UTF8-BOM to UTF8.
Now when I want to write the TXT it is rewritten and constantly. and it only returns the last record? How would they solve it?

let us know:

  • what is the overall goal which is tried
  • the details of the Invoke Method parameters
  • is UTF-8 with or without BOM needed
1 Like

I need it to be UTF-8 without BOM.
I found your solution in another post. But when I applied the method of writing to my TXT it stopped working, it just constantly overwrites. I need each record to be written one below the other.
On the other hand, with the method I did manage to have the encoding in UTF-8

WriteAllText will not append. This could be reason why you will get only the last row
There are also many techniques to avoid the For each

Have a look at:

and check the different Append Methods:
grafik

When it is about writing all first column values to a text file

Assign Acitvity:
strCol1Values =

String.Join(Environment.NewLine, dtPagoSer...Var.AsEnumerable().Select(Function (x) x(0).toString.Trim))

And use strCol1Values in a WriteAllText as done above

So we can avoid a the for each row loop

1 Like

I’m new to UiPath, where do you tell me to add that line?
I’m looping through a datatable

Activities as described
The flow (instead of the For each row)

  • Assign - strCol1Values = … as mentioned above
  • Invoke Code - as you had done, instead of row(0).toString use: strCol1Values

Thats all

1 Like

It’s not working, why should it be?

Invoke Method parameters

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