Monday
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?
Solved! Go to Solution.
Thursday
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).
Thanks and Regards,
Shivakumara Avadhani
18 hours ago
Hello @shivakumara
Your solution (image 1) worked.
Thank you very much!!!
12 hours ago
Hi @energidi ,
Glad to hear that. Happy to help.
Thanks and Regards,
Shivakumara A
Thursday
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
Thursday
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