docs/versioned_docs/version-2.61.0/how-to/use-custom-parameters.md
Custom parameters in your queries offer a flexible way to introduce variables without directly modifying query parameters. This guide will walk you through creating, utilizing, and calling queries with custom parameters.
</div> <div style={{paddingTop:'24px', paddingBottom:'24px'}}>Use parameters.<identifier> in your query to employ custom parameters. Note that parameters can only be used within the query where they are defined.
Let's assume we have a ToolJetDB table with the following columns: name, email, and contact. We will create a new row in the table using custom parameters.
Create a new ToolJetDB query, select a table from the dropdown and select the Create Row operation.
Add the following parameters:
name and value: Shubhemail and value: [email protected]contact and value: 4638563845Add the columns to the query and use the custom parameters to set the values.
| Column | Value |
|---|---|
| name | {{parameters.name}} |
{{parameters.email}} | |
| contact | {{parameters.contact}} |
Finally, execute the query to create a new row in the ToolJetDB table with the values provided in the custom parameters.
In this example, we will demonstrate how to use custom parameters in a query by providing values from an event. We will use execute a REST API query and on its success, we will execute the ToolJetDB query to create a new row with the response data.
Create a REST API Query:
GEThttps://reqres.in/api/users?page=2Add a Success Event:
onSuccessRun QueryCreate Row{{queries.getSalesData.data.data[0].name}} This will use the name from the first record of the response data.{{queries.getSalesData.data.data[0].email}} This will use the email from the first record of the response data.4638563845 provided as a constant value just for demonstration.Execute the REST API query and observe the new row created in the ToolJetDB table.
Note: You can also use parameters in JavaScript queries. Learn more about JS Query Parameter.
<div style={{textAlign: 'center'}}> </div> </div>