NVL Function

  • Last update:January 05, 2026
  • Overview

    Function

    In data entry applications, you may encounter a scenario where only the non-empty values from a group of cells need to be saved to a single database field.

    Explanation

    The usage guide of the NVL function:

    NVL(Value1, Value2, Value3, ...) returns the first non-null value from all parameters.

    iconNote:
    If the parameters of the NVL function are derived from other formula calculations, ensure that the calculation results are not infinite; otherwise, the calculation result of the NVL function may contain garbled characters.

    Example

    Data Creation

    1. Create a table named C in the database, as shown in the following figure.

     1.png

    2. Create a dataset named ds1 with the SQL statement Select * from C.

    Table Design

    Merge cells as needed, and drag the corresponding fields into cells, as shown in the following figure.

     2.png

    Widget Setting

    Add text widgets to cells B5, C5, E5, E6, E7, and E8, as shown in the following figure.

     3.png

    Data Entry Attribute Setting

    1. Select cell E5, add a condition attribute with the formula $$$!=4 to set New Value to null when the current value is not equal to 4, as shown in the following figure.

     4.png

    2. Select cell E6, add a condition attribute with the formula $$$!=2 to set New Value to null when the current value is not equal to 3.

    3. Select cell E7, add a condition attribute with the formula $$$!=2 to set New Value to null when the current value is not equal to 2.

    4. Select cell E8, add a condition attribute with the formula $$$!=1 to set New Value to null when the current value is not equal to 1.

    Other Attribute Setting

    To ensure that cells without widgets (such as those containing Excellent, Good, Qualified, and Poor) are automatically added upon record adding, you can select the cells first, choose Cell Attribute > Others > Row Insert Policy, and select Original, as shown in the following figure.

     5.png

    Report Data Entry Attribute Setting

    Enter the formula=NVL(E5,E6,E7,E8) in Value of NUMBERQ to retrieve the first non-empty value for data entry, as shown in the following figure.

     6.png

    Effect Display

    PC

    Save the template and click Data Entry Preview. The following figure shows the effect.

     7.png

    Click Add Record, and click Submit, as shown in the following figure.

     8.png

    9.png

    The effect of a successful submission is as shown in the following figure.

    10.png

    You can refresh the page to see the successfully submitted value. The submitted value is the first non-empty value, which is 3, as shown in the following figure.

    b.png


    Mobile Terminal

    The preview effects on the DataAnalyst app and the HTML5 terminal are the same, as shown in the following figure.

     gif11.gif

    Template Download

    For details, you can download the template: NVL Function.cpt.

    Attachment List


    Theme: Report Features
    • Helpful
    • Not helpful
    • Only read

    滑鼠選中內容,快速回饋問題

    滑鼠選中存在疑惑的內容,即可快速回饋問題,我們將會跟進處理。

    不再提示

    10s後關閉

    Get
    Help
    Online Support
    Professional technical support is provided to quickly help you solve problems.
    Online support is available from 9:00-12:00 and 13:30-17:30 on weekdays.
    Page Feedback
    You can provide suggestions and feedback for the current web page.
    Pre-Sales Consultation
    Business Consultation
    Business: international@fanruan.com
    Support: support@fanruan.com
    Page Feedback
    *Problem Type
    Cannot be empty
    Problem Description
    0/1000
    Cannot be empty

    Submitted successfully

    Network busy