cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Help with Formula-

tstack
Deputy Chef I
Deputy Chef I

Hello! I'm struggling with an error in one of my formulas 'Formula received a nil value: undefined method `+' for nil:NilClass' After doing some research, I was thinking that using "&" for safe navigation, but still getting the above error.


This is the formula that I am using:

[DATAPILL1]&.presence ? lookup("TABLE_NAME", "FIELD_NAME": [DATAPILL2) ["FIELD_NAME"]+[DATAPILL2]: [DATAPILL3]


the Datapill1 that I'm using to look for the Lookup Table, comes in blank or null every once in awhile. In that case, I want to populate it with Datapill3. However, I am receiving the error rather than the data being replaced with Datapill3 which should be the second condition. Any advise would be great.

10 REPLIES 10

jeff-allen
Deputy Chef I
Deputy Chef I

Try adding the & to your Lookup function as well. This would apply safe navigation to both calls.

rachelnatik
Deputy Chef III
Deputy Chef III

I don't think you can have 2 "ELSE" statements. You would need to use a different formula such as elsif to carry this out.

roland-daane
Deputy Chef II
Deputy Chef II
Create a variable, and if datapil 1 is not present set it to 0.
Then use that variable in the formula.

On top of that keep a reference of the received null values and use that to update the source.

meghan-legaspi
Executive Chef III
Executive Chef III

Hi Tracy Stack! Did any of these suggestions work for you?