Hi @lcx_at,
After trying few things, it seems that a date column needs a date object as input… Something like that should do the trick in your Column value :
{{ new Date($('Switch').item.json["Invoice Date"].split('-')[0],$('Switch').item.json["Invoice Date"].split('-')[1],$('Switch').item.json["Invoice Date"].split('-')[2]) }}
thanks, guess it does kind of work but complicates everything a bit, since it looks quite messy and sometimes dates can be null.
These are the painful moments where I just think to myself that I would have been so much faster writing code than using n8n.
I realized that a simple {{ new Date($('Switch').item.json['Invoice Date']) }} works just as well. If Invoice Date is "", or event if it doesn’t exist at all in the JSON response, it still creates a new row with the InvoiceDate column empty without throwing an error. Not sure if this is the desired behaviour, but it does have the advantage of being simpler than my previous answer.
Bests,
Benjamin
Edit : sorry I didn’t see your last answer as I was posting myself… I see that we had the same idea!