How to create null fields when using formula

Hello,

Was hoping anyone could help.

I want my data to be able to generate either a Yes or NULL in a field. I am currently using the formula:

if this == 'yes' then 'yes' else NULL end

The following error then appears in my SQL Data

“error: Please use field(‘NULL’) to access NULL because it starts with an upper case letter”

What is the correct way to format this?

You want “nil” instead of NULL. Nil represents the null object in Ruby and is automatically converted to NULL when generating SQL. So here’s the full formula:

if this == 'yes' then 'yes' else nil end

1 Like