Duplication Verification of Multi-field Data

  • Last update:  2022-01-20
  • I. Overview

    1. Problem description

    When users enter data in the report, they want to verify the uniqueness of data through two or more fields.


    2. Solution

    When designing a report, multiple fields that need to be verified are spliced. The built-in submission verification formula is set in the data entry attributes to verify whether the spliced fields are duplicate with the existing fields in the database.

    II. Examples

    The following example uses the product name and unit price as the joint primary key to determine whether the input value is duplicated with the existing data in the database.

    1. Data preparation

    Create a new dataset ds1, input SQL query: SELECT *, (Product_name||Unit_price)as aa FROM Product

    Note: in SQL statement (product name | unit price) means to splice product name and unit price into one field.


    2. Template design

    1) The report is designed as follows:

    H2 cell insertion formula: concatenate (B2, C2), which means that the contents of B2 and C2 cells are spliced together when filling in. Hide H2 cells after formula insertion.


    2) In order to add multiple records when filling in the front-end report, it is necessary to set the vertical expansion of the A2 cell, as shown in the following figure:

    4.png


    3) When adding multiple records to the front end, the new row needs to retain the formula in the H2 cell, so the insert row strategy of the H2 cell should be set to the original value, as shown in the following figure:

    5.png


    4) The H2 cell is only used to judge the duplicate data and does not need to be displayed, so the H column can be hidden after the setting is completed.


    6.png


    3. Data entry attributes

    Click  Template > Date Entry Attributes > Submit , add a built-in SQL, and set the reporting properties as shown below


    Add built-in verify. The verification formula is: inarray (H2, DS1. Group (aa)) = 0, indicating that the input data needs to meet the verification formula, that is, it is not in group (aa). Otherwise, an error message will be prompted: "The unit price and name of the current product is duplicate with the existing product."



    4. Effect preview

    1) PC terminal

    Save the report, click data entry preview, and enter the product name and unit price that are repeated in the database. Error information will be prompted during data verification.

    Kapture 2021-01-08 at 14.08.04.gif

    2) Mobile terminal:

    2022-01-20_19-31-33.gif

    III. Template download

    Completed template, please refer to %fr_HOME%\webapps\webroot\WEB-INF\reportlets\doc-EN\DataEntry\DataEntryAttribute\DE_BuiltinDup.cpt

    Click download template: 

    DE_BuiltinDup.cpt

    Attachment List


    Theme: Data Entry
    • 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