When trying to parse the date fields from the output of one Netsuite step to another, you may encounter errors as such:
- Error calculating input for field 'startDate': invalid date
- Invalid dateTime format: 2017-02-01
- #<ArgumentError: wrong number of arguments (given 1, expected 0)>
To successfully map your date across, follow these steps.
Method 1: Check the input date pill's data type and value format
If the input date pill contains a string and is in the format of yyyy-mm-dd or yyyy/mm/dd or dd-mm-yyyy or dd/mm/yy, there is no need to turn on formula mode for the field.
Method 2: Format the string into an appropriate date using .to_date
Else, format the string into an appropriate date using the .to_date function. One example for the format would be %m-%d-%y. Refer to this for more information on date formats.
Method 3: Change the timezone and and format the string with strftime
If you are still encountering errors with mapping the date, you might need to add a function to adjust the timezone appropriately. For example, the formula to use would be
(Date Pill).in_time_zone("US/Pacific").strftime("%Y-%m-%dT%H:%M:%S%z")