info.distanceToNextPoint not working?

I want to use info.distanceToNextPoint in a datafield, but I get a "symbol not found error". I can get heartrate though and info is declared earlier. Is it not possible to use this in a datafield?

fieldValue = (info.distanceToNextPoint != null) ? info.distanceToNextPoint  : 0;
fieldValue = (info.currentHeartRate != null) ? info.currentHeartRate : 0;