Workato · Formulas
Undefined method for nil:NilClass
Undefined method for nil:NilClass means a formula ran on a datapill that had no value at runtime. Add the & safe navigation operator to the formula, for example [Datapill]&.capitalize, so it is skipped when the datapill is null.
VerifiedLast verified
01Error text
Error calculating input for field 'company':
Formula received a nil value:
undefined method `capitalize' for nil:NilClass02Likely causes
- The value of the datapill is null at runtime.
- A Get action returns records with missing fields.
- A Search action returns no results.
- A SQL query returns 0 rows.
03How to fix it
- Open the failed job and find the step and field named in the error, such as
companyin the example. - Find the datapill used in that field's formula, and check the earlier step's output to confirm it was empty.
- Add the
&safe navigation operator before the formula, for example[Datapill]&.capitalize. The formula is applied when the datapill has a value, and it is skipped and returns null when the datapill is null. - Repeat the job to confirm the step now completes.
iNotes
The field name and the formula name in the message are your own. The text above is the example in the Workato documentation. The string formulas page adds that present?, presence and blank? do not raise an error on nil.
04Official documentation
→Related errors
- UndefinedColumn - Column does not existUndefinedColumn - Column does not exist means the database cannot find a column named in the step's SQL. It often happens after a column in the underlying table was renamed, so check the names and refresh the recipe's schema.
- 422 Unprocessable EntityA 422 Unprocessable Entity error in Workato means the external service received the request but could not process it because of a problem with the input data. Look for duplicate unique values, missing records, invalid reference IDs and empty required fields.
Test every fix in a non-production environment before you apply it to production. See how entries are verified.
More for Workato work:Open Workato jobsWorkato rates and salariesHire a senior Workato developer