• Documentation
  • Workato Blog
  • Product Blog
  • Return to Workato
  • Log in
  • ☰
  • Solutions
  • Forums
  • Tickets
New Topic
Discussions Q & A Recipe Errors
S

Saul Macht

started a topic almost 2 years ago
Answered

Formula mode error when 'adding' data pills together using '+'

Hi, I was using a formula like this (data1 + data2 + data3) when I encountered some error messages..


image


Error messages:

1. No implicit conversion of nil into string error

2. Formula received a nil value: undefined method `+' for nil:NilClass


I received the errors on different jobs. One of them had null value in description, the other had null value in amount. I thought that if a data pill was empty/null, then the empty pill would be passed. 


Best Answer
C
Chandra said almost 2 years ago

Hi Saul,


While using + operation on data pills, If any of the data pill expecting to be empty or nil, It should be handled explicitly by using present? or presence. 

Always, when using + with data pills for concatenation, it is a method call. so It tries to evaluate data pills and then concatenate. You have to make sure that pills on both ends should not be nil or empty.

Answer
C

Chandra

said almost 2 years ago

Hi Saul,


While using + operation on data pills, If any of the data pill expecting to be empty or nil, It should be handled explicitly by using present? or presence. 

Always, when using + with data pills for concatenation, it is a method call. so It tries to evaluate data pills and then concatenate. You have to make sure that pills on both ends should not be nil or empty.

Amanda Wong

said almost 2 years ago

You can also refer to this solution article on how to use .present? to handle such errors

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
Expert Hour
Product Hour
Product Blog
Workato Blog
Product updates
Customer Stories
Workato 2018 © | Privacy | Terms | +1 (844) GO-WORKATO
  • Documentation
  • Workato Blog
  • Product Blog
  • Solutions
  • Forums
  • Tickets
  • Log in
  • Return to Workato