--- title: "Constrain DATA sources for tables" slug: "constrain-data-sources-for-tables-tra" updated: 2023-09-27T07:59:32Z published: 2023-09-27T07:59:32Z canonical: "docs.simpleway.cloud/constrain-data-sources-for-tables-tra" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.simpleway.cloud/llms.txt > Use this file to discover all available pages before exploring further. # Constrain DATA sources for tables In this tutorial we'll show you how **to set constraints on data sources for tables**, using features such as filter, sort, limit, and offset. These will help you to define how your data will be listed on the template. By creating one or more data source from one table, you can use one table as separate lists on one template. **Imagine the Use case** that you have one Beverages table created on the Tables tab and on your Template you want to show separately hot and cold drinks. So you create two data sources, one filtered on hot and the second on cold beverages. Topics covered:Data sources tab - Tables type:  - Filter, sort, - Limit and - Offset functions --- **TUTORIAL STEPS:** | Prerequisite**:** - Create a table on the **Tables** **tab** - see how to do this in the [Create and manage your tables](/v1/docs/create-manage-tables) tutorial. - Open the data source for your table on the **Data sources** **tab** - as set up in the previous [Create data sources for tables](/v1/docs/data-sources-for-tables-and-other) tutorial. | | --- | | A) Open on the *Data source* tab an existing item. | ![](https://cdn.document360.io/a3e67867-6316-451b-94ad-ec727ac9102a/Images/Documentation/Slide1(188).JPG) | | | B) **Adding filter** The following function filters rows of a table based on the set value in the specified column. Filtering occurs before sorting, offset, and limit are applied. You may add multiple filters. 1. Click the *Add filter* button. 2. Select the filter type. **Note**: You can set "AND" or "OR" type of logical operator to each individual filter. In case of multiple filters added, all filters of "AND" type will be "anded" together, then each single "OR" filter type will be "ored" with the result of the "AND" filters. | ![](https://cdn.document360.io/a3e67867-6316-451b-94ad-ec727ac9102a/Images/Documentation/Slide2(228).JPG) | ![](https://cdn.document360.io/a3e67867-6316-451b-94ad-ec727ac9102a/Images/Documentation/Slide6(48).JPG) | | C) **Adding filter** 1. Select a *Column* from the drop-down menu with a list of table column names. Rows of the table will be filtered based on the values in the column specified here. 2. Select the *Value* type. 3. Set the *Value*. **Value types**: - **Fixed value** - by selecting this option, you can manually enter a static/fixed value in the **Value** field. - **Display custom field** - by selecting this option, you can select a Display **Custom field/Аsset** in the **Value** field, allowing you to set individual values for each display on the **Displays** tab. | ![](https://cdn.document360.io/a3e67867-6316-451b-94ad-ec727ac9102a/Images/Documentation/Slide3(213).JPG) | | | D) **Adding sort** The following function sorts rows of a table by the specified column. This function sorts the result rows after filters are applied and before the offset and limit is applied. You may add multiple sorts. 1. Click the *Add sort* button. 2. Select the order in which a particular sort is applied. Only sorts with an order of 1 to 9 are allowed. 3. Set the sort type to *A**scending* or *D**escending* order. Ascending order means from smallest to largest (0 to 9) or from first to last (A to Z). Descending order means from largest to smallest (9 to 0) or from last to first (Z to A). | ![](https://cdn.document360.io/a3e67867-6316-451b-94ad-ec727ac9102a/Images/Documentation/Slide4(184).JPG) | ![](https://cdn.document360.io/a3e67867-6316-451b-94ad-ec727ac9102a/Images/Documentation/Slide8(41).JPG) | | E) **Adding sort** 1. Select the *Value* type. 2. Set the *Value*. Rows are sorted by the values of the selected column here. **Value types**: - **Fixed value** - by selecting this option, you can manually enter a static/fixed value in the **Value** field. - **Display custom field** - by selecting this option, you can select a Display **Custom field/Аsset** in the **Value** field, allowing you to set individual sort values for each display on the **Displays** tab. | ![](https://cdn.document360.io/a3e67867-6316-451b-94ad-ec727ac9102a/Images/Documentation/Slide5(149).JPG) | | | F) **Adding limit** The following function limits the number of table rows displayed. You may add only one limit. 1. Click the *Add limit* button. 2. Select the *Value* type. 3. Set the limit (number of rows displayed) in the *Value* field. **Value types**: - **Fixed value** - by selecting the **Fixed value** option, you can manually enter a static/fixed value in the **Value** field. - **Display custom field** - by selecting the **Display custom field** option, you can select a Display **Custom field/Аsset** in the **Value** field, allowing you to set individual limit values for each display on the **Displays** tab. | ![](https://cdn.document360.io/a3e67867-6316-451b-94ad-ec727ac9102a/Images/Documentation/Slide6(122).JPG) | ![](https://cdn.document360.io/a3e67867-6316-451b-94ad-ec727ac9102a/Images/Documentation/Slide10(23).JPG) | | G) **Adding offset** The following function lets you choose how many rows from the start of the table you want to skip. Only one offset function may be added. 1. Click the *Add offset* button. 2. Select the *Value* type. 3. Set the *Value*. The number entered into the *Value* field specifies how many rows from the start of the table should be skipped. If the value is greater than the number of rows filtered, then no rows are displayed. **Value types**: - **Fixed value** - by selecting the **Fixed value** option, you can manually enter a static/fixed offset value in the **Value** field. - **Display custom field** - by selecting the **Display custom field** option, you can select a Display **Custom field/Аsset** in the **Value** field, allowing you to set individual offset values for each display on the **Displays** tab. | ![](https://cdn.document360.io/a3e67867-6316-451b-94ad-ec727ac9102a/Images/Documentation/Slide7(103).JPG) | ![](https://cdn.document360.io/a3e67867-6316-451b-94ad-ec727ac9102a/Images/Documentation/Slide11(12).JPG) | | H) **Preview** the output of you data source configuration with **assigned display configuration** to see how the specific custom field values chosen in your display's configuration affect the outcome. 1. Click the *Select custom field values from display* button and select a display configuration. 2. Click on the "magnifying glass" button to open the data output in JSON format in a new browser window. | ![](https://cdn.document360.io/a3e67867-6316-451b-94ad-ec727ac9102a/Images/Documentation/Slide8(104).JPG) | | | I) Click the *Save* button. The constrained data source for your table is created and you can use it in your templates. | | |