• DOCUMENTATION
  • WORKATO BLOG
  • PRODUCT BLOG
  • Return to Workato
  • Log in
  • ☰
  • Community/Discussions
New Topic
Discussions Recipe Building Recipe Error Troubleshooting
S

Scott Talarico

started a topic over 5 years ago
Answered

to_date formula

I'm working on a conversion using the to_date formula.  Here is the example (Pasted below and attached)


image


This continues to create an error

pdf
Test Activit...
(42.7 KB)

Best Answer
A
Allan Teng said over 5 years ago

Hi Scott, the formula that you are using is wrong. You should not mix text and pills without encapsulating text in ""


Try:


"test - "+<items>+" "+<Date of Event>.to_date

S

Scott Talarico

said over 5 years ago

Can I get an answer on this question? 


Answer

Allan Teng

said over 5 years ago

Hi Scott, the formula that you are using is wrong. You should not mix text and pills without encapsulating text in ""


Try:


"test - "+<items>+" "+<Date of Event>.to_date

S

Scott Talarico

said over 5 years ago

Here is the formula that I'm currently using but instead of exporting Day / Date / Month / Year it's exporting (DD/MM/YYYY)


<items>+""+<Date of Eevnt>.to_date


I have tried using (format: 'MM/DD/YYYY') at the end of the formula but creates the following error

Error calculating input for field 'f_58': wrong number of arguments (given 1, expected 0)

https://www.workato.com/recipes/458523/job/47219275

Allan Teng

said over 5 years ago

That's because f_58 is blank for this record. Check the output from the step you are pulling the data from.

S

Scott Talarico

said over 5 years ago

F_58 is made up of two fields that are pulled from a previous step.  One of the fields is a required field in Quickbase.  The only error I have received in this version of the formula is when I added (format: 'MM/DD/YYYY').  Could it be a different issue?  


Allan Teng

said over 5 years ago

Whenever you use a formula on a pill, you need to make sure there is data in the pill you are using. If there isn't any data, Workato will give you an error at runtime as it is trying to evaluate a null value using  .to_date.


Does that make sens?

S

Scott Talarico

said over 5 years ago

I went back a retested the formula with (format: 'MM/DD/YYYY') - <items>+""+<Date of Eevnt>.to_date(format: 'MM/DD/YYYY').  All data is account for but I still get the exception error.  


Exception: Error calculating input for field 'f_58': wrong number of arguments (given 1, expected 0)

https://www.workato.com/recipes/458523/job/47506129

Allan Teng

said over 5 years ago

Hi Scott, the formula will throw and error if <Date or Event> is blank from the record.


If you see the job output, f_58 (which I assume is for Date or Event), from the previous step is missing from the data output.


Are you saying the data is present in the QuickBase UI? If so, how many fields do you have for this table?

S

Scott Talarico

said over 5 years ago

f_58 is searching for an activity (This is was the topic we spoke about Friday in the expert hour).  This is allowing me to not have duplicate activities.


It outputs correctly without (format: 'MM/DD/YYYY') added to the formula.  See the following

https://www.workato.com/recipes/458523/job/47504899


I only get the error when I try and add the date format to the formula  

Patricia Guevarra

said about 5 years ago

Hi Scott,


Apologies for the delay in response. The error may be because you are using the format MM/DD/YYYY in the formula when the date is in the YYYY-MM-DD format. In the .to_date formula, you are supposed to specify the format the date is currently in. If you want to change the format of the date to something else, you can use the .strftime formula. You can see more information here: http://docs.workato.com/formulas/date-formulas.html#strftime


I hope this helps! Let us know if you need further assistance.

Login to post a comment

Still can't find your solution?

Send us a ticket, we will try our best to assist you with your problem

Documentation
Developer's Library
Tutorials
eBooks
Product Hour
Product Blog
Workato Blog
Product updates
Customer Stories
© Workato 2020   Privacy   Terms   +1 (844) 469-6752
  • Documentation
  • Workato Blog
  • Product Blog
  • Solutions
  • Forums
  • Tickets
  • Log in
  • Return to Workato
Topic views count