Publishing APIs That Support Queries of Null Values

  • Last update: July 04, 2025
  • iconNote:
    This document applies to FineDataLink of V4.2.6.2 and later versions.

    Application Scenario

    You want to publish an API that enables fetching NULL data in the published API and querying other data in the meantime.

    FineDataLink supports passing a NULL value through a parameter in an API.

    1.2(y z.png

    Procedure

    This document uses the SORDER table as an example to illustrate how to publish the table data as an API that enables fetching data where the value of SHIPPED_DATE is NULL and querying other data in the meantime.

    Creating an API

    Click Data Service, choose New > API Service, enter the name of the API service, and click OK, as shown in the following figure.

    2.1.png

    Configuring API Information

    Service Content (Data Query)

    The following figure shows the setting page.

    SELECT * FROM `demotest`.`SORDER` where IF ('$Shipped_Date'='NULL', SHIPPED_DATE IS NULL,SHIPPED_DATE='$Shipped_Date')

    2.2.1.jpg

    The following table describes the setting items.

    For details about each setting item, see Overview of API Release.

    Setting ItemDescription

    SQL Statement

    Enter the statement. This example uses MySQL syntax. Adjust the statements accordingly if you use other databases.

    Pagination Query

    Disable Pagination Query. The API to be generated will return data without pagination after being called.

    Custom Parameter

    Disable Mandatory in Custom Parameter, which means that the parameter value can be empty, and the default value is NULL.

    After publishing the API, you can perform data filtering with the parameter set in the SQL statement during data fetching through the API.

    API Configuration

    1. Select POST as Request Method and set the path to Doc_490. Custom path is supported.

    Add an App. If no App has been created, you can skip this step and bind the API to an App in App List after completing the API creation. For details, see Binding an API to an Application. The binding step is mandatory, otherwise the API cannot be called later.

    Set Request Body Format to application/json, as shown in the following figure.

    For details about each setting item, see Overview of API Release.

    2.2.1.jpg

    2. Click Test Call in the lower right corner to debug the API. The parameter value of area is NULL. Data where the value of Shipped_Date is NULL is returned, as shown in the following figure.

    2.2.2-2.png


    3. Click Save and Activate.

    Subsequent Operations

    If you do not bind the API to a specified App when publishing the API, you can still manage the published API by binding it to an App in App List to ensure that the API can be called.

    For details about using published APIs, see Using APIs Released in Data Service (POST application/json Request).

    You can view the data where the parameter value is NULL, as shown in the following figure.

    3.png

    For details about managing published APIs, see Data Service O&M.

    附件列表


    主题: Data Service
    Previous
    Next
    • 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