FAQ
How can we help?
Full Site Search

    How to Show a Duplicate Warning Without Preventing Saves

    If you want to prevent users from creating duplicate records, you can set up the Unique attribute.

    In some cases, you may want to show a warning without preventing the save when a duplicate value is entered. For example, in a "Contacts" sheet, you might want to avoid creating duplicate records for the same customer. However, since different customers can have the same name, you can configure the system to display a warning when a duplicate name is entered. This notifies the user that a customer with the same name already exists, while still allowing the record to be saved.

    You can follow the steps below:

    Step 1: Open the Javascript Workflow Editor

    Right-click on any sheet name and select Javascript Workflow.

    Step 2: Switch to Global Workflow and Paste the Codes

    function checkIfUniqueFieldValue(fieldId, path){
    var value = param.getNewValue(fieldId);
    var query = db.getAPIQuery(path);
    query.addFilter(fieldId,"=",value);
    var result = query.getAPIResultList();
    if(result.length > 1){
    response.setMessage("The "+ value +" already exists. Please check for duplicates.");
    }
    }
    

    Step 3: Switch to the Post-Workflow of the Sheet You Want To Check for Duplicates

    Enter the script here. For example, if the sheet path you want to recalculate is:

    https://www.ragic.com/accountname/tabname/1?PAGEID=wSM

    (ignore the ?PAGEID=wSM part), and the Field ID is 1000038 (this field must be an independent field and does not support Subtable fields), enter the following in the script::

    checkIfUniqueFieldValue(1000038, "/tabname/1");

    Then click Save to complete the setup.

    Share your feedback with Ragic

    What would you like to tell us?(required, multi select)

    Please provide detailed explanations for the selected items above:

    Screenshots to help us better understand your feedback:

    Thank you for your valuable feedback!

    Start Ragic for free

    Sign up with Google

    Terms of Service | Privacy Policy