Expand my Community achievements bar.

How to check for null value/field?

Avatar

Level 1

Hi!

I have created a form that is designed to calculate the rows using the FormCalc function.

My problem is that if I have no value in the some of the rows, a 0 is automatically display as the calculated output field. If a row has no data, how can I get a null or blank field in the result (calculated field) field?

Let's say, I have 5 rows and each row should have a calculated value in one of the fields; when I fill out only two of the rows, the remaining three rows come out with 0s in the calculated output field. I need a blank output field for the remaining calculated values instead of 0s. I am a newbie so please excuse me if I am not explaining well.

Thanks

Jofar1

4 Replies

Avatar

Level 10

You can check for the emptyness/ nullness of the field by

     FormCalc:

     FieldName.rawValue == null or FieldName.rawValue == ""

     JavaScript:

     FieldName.rawValue == null || FieldName.rawValue == ""

Thanks

Srini

Avatar

Level 1

This is the value that I have on my calculate event: "Rate*Units_of_ServiceRow2".

How should/can I incorporate the two codes?

Avatar

Level 10

An easier way is to use Display Patterns.

With the  field selected to to the Field tab of the Object palette and click on  Patterns, under the Display tab select the checkbox Allow Zero.

Avatar

Level 1

Thanks a lot, Jono.

It works.