Empty Field in Form Logic

Tim Harvey

New Member
In the Form Logic section how do you check if a Control ID is empty or not?

I’ve tried putting nothing in the Value section of the If/Condition (you get an error) and I’ve tried to hand code – if (ControlID 48 != '') but the system automatically changes this to if (ControlId 48 != '''') which isn’t true when the field is empty.
 

Dan Peluso

Member
Staff member
Hi,

It should be ok to leave the If evaluation empty and that should resolve as ControlID 48 != "" which should then evaluate whether the value in Control ID 48 is, in fact, empty. I did just confirm this is the case and appears to be working as expected.

This appears to be working as expected for me. A couple of questions.

1. Is this intended for Android or Windows Mobile?
2. Can you post the version/build you are using? I tried this on our latest release and all seems ok.
3. Can you clarify the steps to reproduce?


Thanks.
 

Tim Harvey

New Member
Hi Dan,

I'm using version 9.

To reproduce:
1. Create on OnSubmit event in Form Logic - under If/Condition insert control ID (mine is 48 which is a text box), set the Comparison Type (I set mine to != but I don't think it matters) then leave the Value blank and close.
2. The If/Condition displays if (ControlID 48 != '') which is what I want.
3. Now try to save the app - File / Save

Message box appears:
Unhandled exception has occurred in your application - Object reference not set to an instance of an object.

Thanks.
 

Dan Peluso

Member
Staff member
Hmm. I am not seeing that behavior. Can you submit your project to us via the support forum? I would like to try to reproduce exactly what you are experiencing. You can post the project here if you like but if there is any sensitive info in there, you may want to use our support ticket system.
 
Top