cancel
Showing results for 
Search instead for 
Did you mean: 

Changing Date Format in Recipe for Google Drive Folders

energidi
Deputy Chef I
Deputy Chef I

Hi everyone,

I have a Workato recipe that connects Salesforce with Google Drive.
In the recipe, I’m creating Google Drive folders where the folder names are based on Contact names and their Date of Birth.

This setup works perfectly.

However, I want to change the Date of Birth format, which comes from the 'Date_of_Birth__c' Contact date field, from YYYY-MM-DD to MM-DD-YYYY.

How can this be achieved?

6 REPLIES 6

rachelnatik
Deputy Chef III
Deputy Chef III

There are several date formulas that can accomplish this.

gary1
Executive Chef III
Executive Chef III

Use this:

"2020-12-12".strftime("%m-%d-%Y")

energidi
Deputy Chef I
Deputy Chef I

Thank you, @gary1 !
The formula works perfectly when written as follows:

[Date_of_Birth__c]=.strftime("%m-%d-%Y")
(The 'Date_of_Birth__c' field is sourced from an output).

However, attempting the formula below, which is what I need, results in the error: Formula has errors

[ContactName__c]_[Date_of_Birth__c]=.strftime("%m-%d-%Y")
(The 'ContactName__c' field is sourced from an output).

Even after removing the underscore, the error persists.

Hi @energidi ,
solution:

Image_1: If the incoming date field is of type Date, there is no need to convert it to Date again. However, make note of the brackets.
Image_2
: If the incoming date field is of type String, it is required to convert the source field to Date (i.e., strftime works on the Date field).


Date_Date1.PNGstring_date.PNG

Thanks and Regards,
Shivakumara Avadhani