In App Forumals, when the lookup function returns no result, the variable does not become blank and main contains the last result that was not blank.
varAppCurrentORT = LookUp(ORTs, sqlID = varAppCurrentORTsqlID);
varAppCurrentPoS = LookUp(PoS, PoSID = varAppCurrentORTPoSID);
varAppCurrentCLLeft = LookUp(CLsDataSLO, SNNumber = varAppCurrentORTCLLeftSN);
varAppCurrentCLRight = LookUp(CLsDataSLO, SNNumber = varAppCurrentORTCLRightSN);
varAppCurrentCLLeftPrec = LookUp(CLsDataSLO, SNNumber = varAppCurrentORTCLLeftPrecSN);
varAppCurrentCLRightPrec = LookUp(CLsDataSLO, SNNumber = varAppCurrentORTCLRightPrecSN);
varAppCurrentPatient = LookUp(Patient, PatientID = varAppCurrentORTPatientID);
I've tried this formula, but the variable doesn't become blank and still contains the last non-blank result
varAppCurrentComments = If(varAppCurrentORTCommentsID>0, LookUp(ORT_Comments, sqlID = varAppCurrentORTCommentsID), Blank());
To test the behaviour I tried forcing the IDs to -1, which should return blank results, without success...
Do you know how to fix this bug? Should I stop using named formulas?