Number fields can be used in formulas in Visual Flow just like number variables. For example, if I have a number field on Account called “PriorDaysWithER” I can use that field in a flow function such as this one where the number of days in a date range are added to the value in that field:

But a (not so) funny thing can happen, and that is your calculation may return nothing (literally nothing – a blank value).

Why is this?

It appears that when a number field has a blank value, when you use that field in a formula you’ll always get a blank value.

Luckily there are two solutions to solving this problem.

**Solution 1**

The first solution is to use a formula to test the field for a blank value. If the formula finds that the field is blank, it returns zero, otherwise it returns the value in the field.

You can now use that formula within another formula, or write one long formula such as the one below (I’ve left off the object name):

**All-In-One Formula**

IF(ISBLANK({!PriorDaysWithER__c}, 0, {!PriorDaysWithER})

+ {!CurrDOT__c} – {!CurrDOH__c} + 1

**Solution 2**

The other solution is in how the field is setup on the object. If the field is setup to have a default value you will not need to test for a blank value in your Flow formula.

One caveat with relying only on this solution, however, is that if the default value of the field ever gets deleted the formula in the Flow will then return a blank value.