Question

Day and Month flip from Zapier to Salesforce.

  • 14 November 2023
  • 10 replies
  • 74 views

We have an integration to Salesforce using a form. However, we are noticing that the dates are flipping in Salesforce. This only occurs when the day is less then 12. For example 08-31-2023 from zapier to Salesforce will insert correctly in Salesforce. However, 08-06-2023 in zapier will flip in Salesforce to 06-08-2023. I have set up a format converter step but this hasn’t solved the issue. The debug shows the date is correct, but when it lands in Salesforce it flips.

Is there something that needs to be done to change this?

Thanks,


10 replies

Userlevel 7
Badge +14

Hi @MomentumWealth 

Good question.

To help us have true context, please post screenshots with how each Zap step is configured with the variable mapped between Zap steps.

@Troy Tessalone 

 

I formatted it to the format that salesforce expects:

 

So the formatter is changing it to the first option.

 

Userlevel 7
Badge +14

@MomentumWealth 

Can you show a screenshot with how Step 5 is configured?

 

@Troy Tessalone 

 

I just added the one to the right. Is this the correct way to do it (remove the left one)?

Userlevel 7
Badge +6

Hi there @MomentumWealth,

I’m jumping in to see if I can help!

You’ll need to remove the mapped data on the left:

c2eea1d7e6e731551f4d34119e88a449.png
(view larger

Hopefully, this helps!

Userlevel 6
Badge +8

> only occurs when the day is less then 12

This smells like a localization issue, like somewhere there’s a mismatch in settings between a system that expects the day to come before the month and another one that expects the reverse. I say this since months, of course, or always less than or equal to 12

Userlevel 1

My team is having the same issue, and we have a much simpler configuration than OP. We take a date formatted as dd/MM/yyyy HH:mm:ss via a Google Form, which then gets fed into Formatter by Zapier. Our use case is simply to prune the time and keep only the date, before creating a new record in Airtable with this date as one of the fields.

Zap trigger → action → result

Like OP, this behaviour seems to only happen when the day is <12, such as in the attached screenshot. We’ve isolated the issue to Formatter by Zapier, since we can clearly see the Data in is formatted correctly while Data out is flipped. That suggests a configuration error in Formatter by Zapier, but everything looks fine on our end, though we haven’t set the From Format field.

Data in → Data out (Formatter by Zapier)
Formatter by Zapier settings

Any suggestions from the Zapier team?

Userlevel 7
Badge +6

Hi there @In2science,

We have a community post about working with dates and times here that touches on why the month and day are being swapped:

The solution is to use a formatter step to explicitly set the date format in the format that Salesforce is expecting: YYYY-MM-DDThh:mm:ss+hh:mm

Hopefully, this helps!

Userlevel 1

Hi @ken.a,

Thanks for your response. I had a read of the article and it makes sense, but the use case is not the same; we are not using Salesforce in our Zap (the workflow is Google Sheets → Formatter by Zapier → Airtable) and I can observe the date is being flipped inside the Formatter by Zapier step (i.e. DD/MM in, MM/DD out) before it even gets to Airtable.

I tried specifying the From Format field, but there is no option that matches the incoming date format, i.e. DD/MM/YYYY HH:mm:ss, and I am not able to enter my own custom format.

I can see there is a From Format field that matches DD/MM/YYYY (without the timestamp as well) and since we are removing the time anyway, this might work. I’ll give it a try and report back.

Userlevel 1

Hi all, just an update that setting the From Format field to DD/MM/YYYY worked for us.

Updated steps including correct Data in and Data out

However, if someone was in the same situation and needed to preserve the time as well as the date, I’m not sure there is any solution. I’d recommend the Zapier team add an option like DD/MM/YYYY HH:mm:ss for that situation, or better still allow custom date/time formats to be specified using a standard like SimpleDateFormat (Java Platform SE 7 ) (oracle.com).

Thanks for everyone’s assistance!

Reply