Append to csv encoding value cannot be null error

Hi, I received this error message when appending a dataframe to a csv file. Can someone shed a light on why it complains about encoding being null when it’s an optional field? All other fields(dataframe, the csv file, etc) are all there.
Thanks!

hi @aychn,

welcome to the Community !

Before appending the DataSet, can you please verify that it is not null.
This can be validated as DataTablevariable is Nothing

image

So, take an if Statement and If DataTableVariable is Nothing , skip the append.


Mukesh

Hi, thanks for the input. The datatable is not null - I checked twice, once in debugging mode to see the exact value and using an if statement like you suggested.
I’m curious about the error message, what does “Value cannot be null. Parameter name: encoding” mean, especially the encoding part?

https://docs.uipath.com/activities/docs/append-csv-file

There is a section for Encoding in the above link. Think that would be helpful.

Thanks! This is where I don’t understand, why does UiPath Studio complain about encoding being null when it’s an optional field?

1 Like

pass this: System.Text.Encoding.Default.EncodingName

Hi @aychn,

Please provide the encode values, like utf-8,…etc. It worked for me :smiley:.

image

You can get all the list of encoding names below.

4 Likes