How to convert date, if cell is empty

Hi to all,
I have a problem, of conversion, with a date, when the field is empty, to import it on DB.
I scrape this situation:

The second column, of the table, does not contain any reference date.

I have to import the data on a db.
The NULL field is enabled on db.
The NULL option is also enabled in the Build Table.


Despite these settings, the bot fails.

Otherwise, if I assign a fictitious date, ex: 1999-01-01, everything works correctly.
Is there any way x to load NULL value or leave cell blank on DB?
Thanks for all…

Hi @AaronMark ,

Could you show us what is the expression used in the Assign Activity ?

I have made several attempts.
Right now it’s like this:

Hi @AaronMark ,

I would suggest you to go through the below Post :

In accordance with that, we would require to know whether there are different formats of date present in the data.

Once we identify the format/formats of date values we can use the solutions provided in the post to convert to DateTime.

Try to Debug the workflow and Check the value of Data_Completamento_Ordine when it errors out in the Debug Panel.

We should be able to understand the cause better in that way.

The Bot fails in the Add Data Row activity.
The data collection seems to take place correctly.
That is, the date field in the table is empty and the bot does not assign any value.


Having allowed the NULL field on the table, I thought that the data would be automatically converted.
But this does not seem to happen.

In True part of if condition, instead of String.Empty use DBNull.Value
if you still faces issue let us know

Problem solved, but I came across your advice,
with another forum post.
Not knowing the DBNull.Value.
I found this statement that worked perfectly: “Depends on what is the type of the parameter, but maybe try assign parameter value to DBNull.Value and for string, maybe a simple Nothing could work.”

So I solved with Nothing

1 Like