I am exporting data from a CSV file located in FTP location and importing it into Netsuite to create a Bill. One of the fields in the Bill expects a value for "Date" and the csv file doesn't have that data. We want that date to be the current date whenever the integrations runs. At the import side (Netsuite), how do I map the Date field in order to ensure it takes the current date?
Hi @swapnilshah, I think you just need to hardcode that field with the following handlebars expression:
{{timestamp MM-DD-YYYY}}
Please let me know if that solution works for you.
Tom
Hi Tom, It didn't work. I used the following handlebars expression:
{{timestamp MM/DD/YYYY}}
It gave me below error message:
"Failed to create, update/transform record because You have entered an Invalid Field Value NaN/NaN/ NaN for the following field: trandate"
What should I try?
Hi @swapnilshah,
{{timeStamp}} generates a UTC value, which is usually what NetSuite expects.
That "trandate" error might be a clue that you have to send MM/DD/YYYY instead. Try this slightly modified handlebars statement to convert it to that format:
{{dateFormat "MM/DD/YYYY" timeStamp}}
Tom
Hi Tom,
Thanks for your help. I tried the new handlebars expression. I am getting the below error message now:
"Invalid date(time) value: {{dateFormat \"MM/DD/YYYY\" timeStamp}} with date(time) format: MM/DD/YYYY"
Please advise.
Thanks,
Swapnil Shah
Hi @swapnilshah,
Can you please try the following?
{{dateFormat "MM-DD-YYYY HH:mm:ss" timeStamp}}
Tom
Hi Tom,
The following handlebars expression worked when I tried again:
{{dateFormat "MM/DD/YYYY" timeStamp}}
Thanks for your help, I really appreciate it!
Regards,
Swapnil Shah