Dataset States in Qntrl Circuit | Filter, Limit, and Remove Duplicate Records | Circuit Online Help

Data Set

Dataset states help you manage and refine collections of records before passing them to the next step in a circuit. These states operate on arrays of objects and are designed to filter, limit, or deduplicate data for cleaner, more efficient processing downstream.
Available States  :
  1. Limit
  2. Remove Duplicates

Limit 

Restricts the number of records returned from a dataset by selecting either the first or last N records from an array.

Builder View Configuration  
  • Data: Array of objects to be processed (static or dynamic).

  • Limit: Maximum number of items(N) to return.

  • Bound: Determines which end of the array to select from. Choose First to return the first N records or Last to return the last N.

Example:  

If Limit is set to 4 and Bound is first, the first four records are returned. If Bound is last, the last four records are returned.  

Code View  

"Limit dataset": {

    "start": true,

    "module": "dataset",

    "task_id": "limit",

    "payload": {

"data": [

     { "category": "reference", "price": 8.95, "title": "Sayings of the Century" },

                  { "category": "fiction", "price": 8.95, "title": "Sayings of the Century" },

     { "category": "fiction", "price": 8.99, "title": "Moby Dick" },

     { "category": "fiction", "price": 22.99, "title": "The Lord of the Rings" }

],

"limit": 2,

"bound": "first"

    },

    "next": "End"

}

Remove Duplicates 

Eliminates duplicate records from an array of objects to ensure data integrity before processing.

Deduplication Logic  

  • No keys specified: Removes duplicate objects by comparing all fields (retains the first occurrence).

  • Specific keys specified: Removes objects that have duplicate values for the given keys.

  • Object specified as key: Removes duplicates only when all fields match.

  • Exclude enabled: Removes duplicates based on all keys except the specified ones.

 

Builder View Configuration  

  • Data: Array of objects to process

  • Keys: The fields to evaluate for duplication (optional)

  • Exclude: Exclude specified keys from duplication logic. select the checkbox if required.

 

Code View

{

    "Remove duplicate": {

"start": true,

"module": "dataset",

"task_id": "remove_duplicate",

"payload": {

    "data": [

{ "category": "reference", "price": 8.95, "title": "Sayings of the Century" },

{ "category": "fiction", "price": 8.95, "title": "Sayings of the Century" },

{ "category": "fiction", "price": 8.99, "title": "Moby Dick" },

{ "category": "fiction", "price": 22.99, "title": "The Lord of the Rings" }

    ],

   "keys": ["category"],

   "exclude": true

},

"next": "End"

   }

}

    • Related Articles

    • Business case 3: Use client scripts to fetch data from third party applications or websites

      While designing forms, we might sometimes want to display data from other websites or applications like stock rates, flight status, freight details, weather updates, and so on. To fetch such information from third party websites or applications and ...
    • Business case 1: Use client scripts to perform mathematical calculations and validations on data

      While designing forms to replicate finance related documents like purchase order, invoice, or reimbursement bills, our workflows might require the calculation of total cost or sum of expenses incurred. To automate such mathematical calculations and ...
    • Manage Tables

      Tables help you store reference data in a tabular format within Qntrl . You can store data vital to support your business processes here. Also, the data in tables can be listed in cards using Table Lookup . For example, Zylker-- a manufacturing ...
    • Manage Client Scripts

      Client Scripts are used to incorporate additional validations to business data while they are recorded in Qntrl. In client scripts, you can code using JavaScript and run the code on the end-user’s browser while they are creating a new card or ...
    • Sample Use Cases

      Payment process In a typical payment process, for every purchase made, a payment link with the invoice will be shared with the purchaser. Upon successful payment, a receipt will be generated; in the event of failure, the entire process will have to ...