Error in handlebar expression
Hi,
I have custom flow which export customer and order data from FTP server and create Customers and Sales order in NetSuite. In the Sales order import step, an error is thrown related to Shipping cost calculation. Hence I added a mapping for Shipping method using handlebar as
{{#compare ShipToCountry "==" "CANADA"}}10205{{else}}3105{{/compare}}
mapped to Shipping Method(InternalId)
Now the flow throws another errors as
Could not compile handle bar "{{#compare ShipToCountry "==" "CANADA"}}10205{{else}}3105{{/compare}" because "Parse error on line 1: ...else}}3105{{/compare} -----------------------^ Expecting 'CLOSE_RAW_BLOCK', 'CLOSE', 'CLOSE_UNESCAPED', 'OPEN_SEXPR', 'CLOSE_SEXPR', 'ID', 'OPEN_BLOCK_PARAMS', 'STRING', 'NUMBER', 'BOOLEAN', 'UNDEFINED', 'NULL', 'DATA', 'SEP', got 'INVALID'" .Please correct and retry
My order data look like following
Please suggest the soltuion for the issue.
Comments
Aishwarya M J in your error message, it shows you are missing a closing curly bracket at the very end. However, in your posted example of the expression you are using you have it. I'm able to get the same error if I leave off the last bracket, but can't get the same error if I have it. Can you confirm you do or don't have that last curly bracket on the mapping? Maybe screenshot your mappings as well and post here.
Beat me to it! i saw that too.
Hi Tyler Lamparter,
Thanks for the update. I have corrected the error by adding the missing closing bracket. Actually I did the mapping for Shipping method to resolve another error in my flow which is
"Failed to save record because Could not calculate cost for the selected Realtime rate. The requested service is unavailable between the selected locations."
Do you have any idea on this error?
Thanks in advance.
Aishwarya M J that sounds more like an issue with your NetSuite config or the mappings. Here are a couple posts that may help you troubleshoot:
You can map the "use dynamic mode" and mimic entering as if you were in the UI. See articles here:
Please sign in to leave a comment.