{"section":"tutorials","requestedLocale":"en","requestedSlug":"creating-custom-queries-in-master-data-v1","locale":"en","slug":"creating-custom-queries-in-master-data-v1","path":"docs/en/tutorials/master-data/master-data-v1-applications/creating-custom-queries-in-master-data-v1.md","branch":"main","content":"A custom query in Master Data is a filter or combination of filters that can be saved and accessed directly in a form's record list.\n\n## Prerequisites\n\nBefore creating a query, follow the steps described in[ How to filter data in Master Data](/en/docs/tutorials/filtering-data-on-master-data) to set up a filter in the data entity and the form.\n\n## Saving a query\n\nFollow the steps below to filter the form records and save a custom query.\n\n1. In the VTEX Admin, go to **Store Settings** > **Storefront** > **Master Data**.\n2. Make sure you are in the **Applications** tab.\n3. In the desired application, find the form you want to view and click the list icon <i class=\"fas fa-bars\"></i>.\n\n    You will be redirected to the list of records for this form. On the side, you will see the configured filters.\n4. To filter, select the filter name and value, then click `Filter`.\n\n    You can filter by multiple fields at once, and use multiple values for a single field. To remove a filter, click the `X` next to its value.\n5. Click the `Save Query` button.\n6. Add a name to the custom query.\n7. Click `OK`.\n8. Click `OK` again.\n9. Click the **Applications** tab.\n10. Click the `Reload Applications` button.\n\nAfter following the instructions above, the query will appear as a display option in the form list.\n\n![queries-2-en](https://cdn.statically.io/gh/vtexdocs/help-center-content/refs/heads/main/docs/en/tutorials/master-data/master-data-v1-applications/creating-custom-queries-in-master-data-v1_1.png)\n\nYou can also access the saved queries by clicking the __Queries__ button in the form list:\n\n![queries-en](https://cdn.statically.io/gh/vtexdocs/help-center-content/refs/heads/main/docs/en/tutorials/master-data/master-data-v1-applications/creating-custom-queries-in-master-data-v1_2.png)\n\n## Configuring a default query\n\nTo set a form to always open the list with a custom query instead of displaying all the records, you can configure a default query. To do this, follow the steps below:\n\n1. In the VTEX Admin, go to **Store Settings** > **Storefront** > **Master Data**.\n2. Make sure you are in the **Applications** tab.\n3. In the application where you want to change the form, click the gear symbol <i class=\"fas fa-cog\"></i>.\n4. Click the edit icon <i class=\"fas fa-edit\"></i> on the form row where you want to add the default query.\n5. In the **Default query** option, select the custom query you want to display whenever you open the form's record list.\n6. Click `Save`."}