Returns the field itself if it is not null; otherwise, replace-with is returned.
Built-in, C++, C#, Java.
The database field.
The replacement value.
The mapping below shows an example of the substitute-null function in use. This mapping is called DB-ApplicationList.mfd and is available in the <Documents>\Altova\MapForce2023\MapForceExamples\ folder.
The mapping reads data from an Access database which contains an "Applications" table.
The first function checks if the Category field is null in the "Applications" table. Since this field is null for the Notepad application, the substitute value "Misc" is mapped to the Category item of the target text file.
The second function checks if the Description field is null. Again, this field is null for the Notepad application, so the substitute value "No description" is mapped to the Description item of the target file.