--- title: "Utilities Component" slug: "utilities-component" updated: 2024-03-27T04:30:27Z published: 2024-03-27T04:30:28Z canonical: "help.pillir.io/utilities-component" --- > ## Documentation Index > Fetch the complete documentation index at: https://help.pillir.io/llms.txt > Use this file to discover all available pages before exploring further. # Utilities Component The Utilities component consists of blocks that perform sorting and grouping actions. ## Object Sort The Object Sort block sorts JSON array data based on the specified sorting type. | Input | Output | Block Layout | Generated Code | | --- | --- | --- | --- | | Choose the sorting type: (Ascending, Descending) ParamName as a variable or Text-input-1 JSON array data as variable or object data-input-2 | Returns Sorted JSON object based on sorting type. | ![](https://cdn.document360.io/718af901-247b-46be-8ace-83da21839237/Images/Documentation/image-1620914139475.png) ![](https://cdn.document360.io/718af901-247b-46be-8ace-83da21839237/Images/Documentation/image-1620914158812.png) | JavaScriptJavaScript ```javascript __er.sortObject("ascending", 'parameter', obj ); ``` | ## Object GroupBy The Object GroupBy block groups JSON array data based on the specified parameter. | Input | Output | Block Layout | Generated Code | | --- | --- | --- | --- | | Parameter Name as a variable or Text - input-1 JSON array data as variable or object data - input-2 | Returns Grouped JSON object. | ![GroupBy](https://cdn.document360.io/718af901-247b-46be-8ace-83da21839237/Images/Documentation/GroupBy.png) | JavaScriptJavaScript ```javascript (__er.groupBy('parameter', obj)); ``` | ## Object(Table) filter The Object filter block searches within a table variable for records that meet a specified condition and returns those filtered records. - The column given inside the filter condition must be either defined as a **Primary key** or an **indexed** column. - You can add multiple filter conditions inside the block. - The operators that can be used in the filter condition are (EQUAL, STARTS_WITH, and IN). For example: You have a **Details** table, with columns Name, Id and Role. You are required to filter the table based on **Id**, where Id is a user input field. To do this operation the object filter block is used as follows: | Input | Output | Block Layout | Generated Code | | --- | --- | --- | --- | | - Object filter - Select the table name on which the filter condition should be applied - Filter Criteria (can apply multiple conditions) - Key - column name is the filter criteria - Operator - Select the operator - Value - column value | Set - Select the output table name | ![object filter-new](https://cdn.document360.io/718af901-247b-46be-8ace-83da21839237/Images/Documentation/object%20filter-new.png) | ```javascript async function er_1700464931_click(e,obj,index){ __er.setState("Details2", await __er.filterObjects("Details",[ {"name": "Id", "condition": "EQ", "value": (await __er.getState("Id")) , "op": "AND", "value_2": ""},])); ``` | ## Object isExist The Object isExist block searches within a table variable for records that meet a specified condition and returns the output as a **Boolean(True or False)** value. If True, the record exists and if False - the record does not exist. - The column given inside the filter condition must either be defined as a **Primary key** or an **indexed** column. - You can add multiple filter conditions. - The operators that can be used in the filter condition are (EQUAL, STARTS_WITH, and IN). For example: You have a **Details** table, with columns Name, Id and Role. You are required to check whether a record exists based on the Id, where Id is a user input field. To do this operation the Object isExist block is used as follows: | Input | Output | Block Layout | Generated Code | | --- | --- | --- | --- | | - Object filter - Select the table name on which the filter condition should be applied - Filter Criteria (can apply multiple conditions) - Key - column name is the filter criteria - Operator - Select the operator - Value - column value | Set - Select the output variable | ![objectisexist](https://cdn.document360.io/718af901-247b-46be-8ace-83da21839237/Images/Documentation/objectisexist.png) | ```javascript async function er_1700541435_click(e,obj,index){ __er.setState("Boolean", await __er.objectIsExist("Details",[ {"name": "Id", "condition": "EQ", "value": (await __er.getState("Id")) , "op": "AND", "value_2": ""},])); } ``` |