Official Content

Retrieves the “null” value of an attribute or variable. That value may be empty or the Null itself, depending on the context where the function is used.


Nullvalue(attribute | &variable)


Objects: Procedure, Transaction, Web PanelWork Panel
Generators: .NET, Java, Ruby (up to GeneXus X Evolution 3), RPG, Visual FoxPro (up to GeneXus X Evolution 3), Cobol


It can be used in assignments and conditions with slightly different results:


  • To assign an empty value to an attribute or set it as Null. It depends on the Generate null for nullvalue() property.  
  • To avoid the property dependence use the SetNull() or SetEmpty() methods.
  • To initialize variables with their empty value.


  • Using the function with variables means that the corresponding empty value will be considered.
  • Using the function with attributes will depend on whether the condition is evaluated on the server or the client.


For Each
     Where Att = Nullvalue(Att)

In this case the For Each considers those records with an empty ATT.

For Each
     If Att = Nullvalue(Att)

In this case the For Each retrieves records where Att is empty or Null.

Note that in this case the function does not take into account the Generate null for nullvalue() property.

If nullvalue is assigned to an attribute in a Data Provider, it will set an empty value instead of null.

See Also

Null function
IsNull function
SetNull method

Last update: November 2023 | © GeneXus. All rights reserved. GeneXus Powered by Globant