cancel
Showing results for 
Search instead for 
Did you mean: 

Changing Date Format in Recipe for Google Drive Folders

energidi
Deputy Chef II
Deputy Chef II

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?

1 ACCEPTED SOLUTION

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

View solution in original post

8 REPLIES 8

Hello @shivakumara 

Your solution (image 1) worked.
Thank you very much!!!

Hi @energidi ,
Glad to hear that. Happy to help.

Thanks and Regards,
Shivakumara A

Ozdemira
Deputy Chef I
Deputy Chef I

this should work: "#{ContactName__c}_" + Date_of_Birth__c.strftime('%m-%d-%Y'
Is it recognised as a date/time string?  If not you can parse it to a date time format:

"#{ContactName__c}_" + Date.parse(Date_of_Birth__c).strftime('%m-%d-%Y')

Maybe try the To-date formula see if it recognises it as a datetim? https://docs.workato.com/formulas/date-formulas.html#to-date 

Prudvi
Deputy Chef II
Deputy Chef II

Hi @energidi ,
The formula error which you see is because you are converting the date field to string.
And when we are using a formula toggle option, we must concatenate it to the strings.

Example : [ContactName]+"_"+[DOB].strftime("%m-%d-%Y"))
Can you please check.
Regards,
Prudvi