Mapper 2.0 - Handlebar Date Conversions

Hello All,

I'm trying to perform PST to UTC Conversion through handlebars in the Mapper 2.0 for the bulk import mode.

On Trying the handlebar expression ({{dateAdd (dateFormat "YYYY-MM-DDTHH:mm:ssZ" updated_at "MM/DD/YYYY HH:mm a" "UTC") "25200000"}}) out in handlebar editor, for the input of 05/20/2025 2:31 am, i'm getting result as '2025-05-20T09:31:00.000Z'

But Post saving this, and testing preview on mapper 2.0 for the same input, i'm getting invalid_date.

Any ideas on how to resolve this.

Thanks for any inputs shared

@Varun_Thangaraj - If the input structure shown in the mapper's input section looks like below:

{
  "updated_at": "05/20/2025 2:31 am"
}

then use 'record.updated_at' to reference the 'updated_at' value in the handlebar expression.

Hi @sreevaniamara ,

Thanks for the reply.

Even on referencing as record.updated_at, i'm still getting invalid_date.

My confusion is the difference on evaluation of handle bars inside editor and mapper 2.0.

Expression:

{{dateAdd (dateFormat "YYYY-MM-DDTHH:mm:ssZ" record.updated_at "MM/DD/YYYY HH:mm a" "UTC") "25200000"}}

Input

{
  "updated_at": "05/20/2025 2:31 am"
}

output:

[
  {
    "updated_at": "Invalid date"
  }
]

Note:
I'm creating destination rows from source records

@Varun_Thangaraj, can you please share screenshots of your mapping along with input and output, please mask any sensitive information. This will help us analyse the issue.

Hi @sreevaniamara ,

Please find the info below
Mappings:

input

{
  "netsuite_invoice_internal_id": "74774763",
  "invoice_no": "temp",
  "status": "Paid In Full",
  "date": "02/01/2022",
  "due_date": "02/01/2022",
  "total_amount": "148.99",
  "paid_amount": "148.99",
  "remaining_amount": ".00",
  "billed_contract_id": "",
  "type": "temp",
  "paying_terms": "temp",
  "generated_from": "temp",
  "created_at": "02/01/2022 10:46 pm",
  "updated_at": "05/20/2025 2:31 am"
}

output is same , only created_at,updated_at has handle bar expressions to convert timezone

Couple questions:

  • What database/datawarehouse are you trying to bulk load into?
  • I'm not able to reproduce this and preview is working fine for me. Can you share your flow zip?

Additionally, I would highly recommend doing this instead/in addition to:

My setup for reference:



1 Like

Hi @tylerlamparter ,

Thanks a lot, the Saved Search Approach worked like charm.

Will check with fresh flow once why my flow is throwing error though.