I hoped this would return in a Salesforce Date Time format (2024-10-9T12:15:20Z)and could then be inserted but this sets the field to a null; no error thrown.
Is it possible to take a NetSuite date string, format the date and also append a time stamp onto the end of it?
Celigo AI keeps suggesting a change to the NetSuote saved search but this unfortunately is not an option, I need to make these changes in Celigo.
I understand that you can't change the saved search this is pulling from. The reason why that is preferred is because the date format in NetSuite is subject to user and company preferences, and so could change without warning in the future, causing unexpected behavior in the flow. I prefer to use a Formula (Text) field in searches over native date fields because this allows the format to be hard-coded directly within NetSuite.
That being said, it is possible to do what you are trying to do with handlebars. The reason yours did not work is because the input and output formats need to be quoted.
For example using an acceptedDate of “04/10/2024”:
Thank you, but that's my fault for not formatting the question well enough.
In reality, I have this exact code currently in Celigo, even with the lowercase mm, but the preview window shows null and if I ran any records, nothing is inserted.
And here is a subsection of the input data. The entire input is very large and most of it is not required but tthe sub structure of ‘CustomerRecord’ holds the data we need:
I would try going through each step and repopulate the mock input and output data just to be sure there were no accidental changes. Also, try running it in test mode and/or check any logs you have on the Salesforce side to see what exactly is being imported into Salesforce. Is it possible that this is a date-only field that doesn't accept a timestamp?
If anyone else has any suggestions, please add them, but at this point you do seem to be doing everything correctly.
A similar ask was required in a different flow with a slightly different structure but when I used the above option, it worked first time as expected.
I went back to the mapping which caused this issue and confirmed they were the same (excluding the structure of the data) but again it did not work. I also deleted this mapping, saved and then re-added from scratch.
As a final test, deleted the entire node as there were very few mappings in it, and recreated fresh. And it worked exactly as expected.
So it seems there was nothing wrong with the formula; there was something funky under the hood which was causing this to fail.
If anyone else experiences this issue, I would suggest first deleting the mapping and trying again after a save, or if really required, delete the entire node and recreate.
I don't seem to be able to move this to the ‘Troubleshoot custom flows’ section myself but please feel free to move it there yourself if you can.