What's the function for checking if Client Variable is Null?

Two questions:

The first is, what is the default value of client variables, if there was no input from user and thus nothing assigned to them? I'm assuming the answer is null.

Second question, what's the syntax for checking if a certain client variable was not entered by the user (i.e. is Null)?


Thanks in advance.

Akis M wrote:

Two questions:

The first is, what is the default value of client variables, if there was no input from user and thus nothing assigned to them? I'm assuming the answer is null.

Second question, what's the syntax for checking if a certain client variable was not entered by the user (i.e. is Null)?


Thanks in advance.

Hi Aksi,

For the first, it will take the default value according to data type.

For the Second, let suppose say if we have variable "var" then syntax to check for if the type is number then Var <> 0 and if it is text then var <> ''.

Cheers....  


Hi Akis,

for client variables default value be their default value according to data type. like if its an integer then default value will be 0. 

For second question want to know, why you want to do this comparison. 

Thanks.

Vikas Sharma wrote:

Hi Akis,

for client variables default value be their default value according to data type. like if its an integer then default value will be 0. 

For second question want to know, why you want to do this comparison. 

Thanks.

I have a bootstrapped excel table from which data is pulled based on some user inputs. However, the table is not always completed up to the latest date. Which might result in some invalid operations such as number divided by 0 or 0 divided by 0 or 0 divided by 0. I want to add an if check where if the data input resulted in this type of operation, then the user should manually enter the value that would normally be in the table if fully updated.

I guess I will just use Not Client.VariableName = 0

Solution

Akis M wrote:

Two questions:

The first is, what is the default value of client variables, if there was no input from user and thus nothing assigned to them? I'm assuming the answer is null.

Second question, what's the syntax for checking if a certain client variable was not entered by the user (i.e. is Null)?


Thanks in advance.

Hi Akis,

OutSystems has functions that return Null values, like NullIdentifier() returns a Null identifier. For more types, see: https://success.outsystems.com/Documentation/11/Reference/OutSystems_Language/Logic/Built-in_Functions/Data_Conversion

You can compare the client value with these values.

Hope this helps

Orla


Solution

Hi Orla,

using above  null Identifiers, you can't compare integers and other basic data types. You can compare with their default values manually. Also for exception conditions, add exception handlers in the application.

Thanks.


Orla Dijkink wrote:

Akis M wrote:

Two questions:

The first is, what is the default value of client variables, if there was no input from user and thus nothing assigned to them? I'm assuming the answer is null.

Second question, what's the syntax for checking if a certain client variable was not entered by the user (i.e. is Null)?


Thanks in advance.

Hi Akis,

OutSystems has functions that return Null values, like NullIdentifier() returns a Null identifier. For more types, see: https://success.outsystems.com/Documentation/11/Reference/OutSystems_Language/Logic/Built-in_Functions/Data_Conversion

You can compare the client value with these values.

Hope this helps

Orla



Thanks Orla, follow up question:

If an invalid operation is performed such as division by 0, what is the resulting variable? Is it a null or a 0?

Akis M wrote:

Orla Dijkink wrote:

Akis M wrote:

Two questions:

The first is, what is the default value of client variables, if there was no input from user and thus nothing assigned to them? I'm assuming the answer is null.

Second question, what's the syntax for checking if a certain client variable was not entered by the user (i.e. is Null)?


Thanks in advance.

Hi Akis,

OutSystems has functions that return Null values, like NullIdentifier() returns a Null identifier. For more types, see: https://success.outsystems.com/Documentation/11/Reference/OutSystems_Language/Logic/Built-in_Functions/Data_Conversion

You can compare the client value with these values.

Hope this helps

Orla



Thanks Orla, follow up question:

If an invalid operation is performed such as division by 0, what is the resulting variable? Is it a null or a 0?


HI Akis,

As mentioned already , for handling this kind of situation you need to add proper exception  handling in your program.

Thanks.

Vikas Sharma wrote:

Akis M wrote:

Orla Dijkink wrote:

Akis M wrote:

Two questions:

The first is, what is the default value of client variables, if there was no input from user and thus nothing assigned to them? I'm assuming the answer is null.

Second question, what's the syntax for checking if a certain client variable was not entered by the user (i.e. is Null)?


Thanks in advance.

Hi Akis,

OutSystems has functions that return Null values, like NullIdentifier() returns a Null identifier. For more types, see: https://success.outsystems.com/Documentation/11/Reference/OutSystems_Language/Logic/Built-in_Functions/Data_Conversion

You can compare the client value with these values.

Hope this helps

Orla



Thanks Orla, follow up question:

If an invalid operation is performed such as division by 0, what is the resulting variable? Is it a null or a 0?


HI Akis,

As mentioned already , for handling this kind of situation you need to add proper exception  handling in your program.

Thanks.

I'm a beginner and practising building a beginner app, so I'm trying to do it in the simplest way possible. I haven't had the time to use exception handling yet, and I'm sure that what I'm asking is doable with simple if checks as well, without needing exception handlers.


Akis M wrote:

Orla Dijkink wrote:

Akis M wrote:

Two questions:

The first is, what is the default value of client variables, if there was no input from user and thus nothing assigned to them? I'm assuming the answer is null.

Second question, what's the syntax for checking if a certain client variable was not entered by the user (i.e. is Null)?


Thanks in advance.

Hi Akis,

OutSystems has functions that return Null values, like NullIdentifier() returns a Null identifier. For more types, see: https://success.outsystems.com/Documentation/11/Reference/OutSystems_Language/Logic/Built-in_Functions/Data_Conversion

You can compare the client value with these values.

Hope this helps

Orla



Thanks Orla, follow up question:

If an invalid operation is performed such as division by 0, what is the resulting variable? Is it a null or a 0?


Hi Akis,


In this case an Exception will be thrown and there is nothing to compare.


Kind regards,

Detlev