how can i make query parameters to be dynamic
# ask-ai
h
how can i make query parameters to be dynamic
k
To make query parameters dynamic in Airbyte's Connector Builder, you should use user inputs. This allows the end user configuring the connector to supply values for query parameters at runtime. Here’s how you can do it: 1. Add a Query Parameter: In the Connector Builder UI, scroll to the "Query Parameters" section and add a new parameter. 2. Set the Key: Enter the key for your query parameter (e.g.,
base
). 3. Make the Value Dynamic: - Click the user icon next to the value input. - Select "New user input". - Name the input (e.g., "Base"). - Click "Create". The value will now be set to a placeholder like
{{ config['base'] }}
. When the connector runs, this placeholder is replaced by the value provided by the user during source configuration. This approach can be used for any field that supports user input, making your query parameters fully dynamic and user-configurable. Example:
Copy code
json {   "base": "USD",   "date": "2023-04-13",   "rates": {     "AED": 3.6723,     "AFN": 86.286329     // ...   } }
In this example, the
base
parameter is dynamic and set by the user at configuration time, resulting in the API returning rates based on the selected base currency [Making the stream configurable](https://docs.airbyte.com/platform/connector-development/connector-builder-ui/tutorial#making-the-stream-configurable). You can use this dynamic approach for any query parameter by referencing the user input with the
{{ config['your_input_name'] }}
syntax. This method is supported in all fields with a user icon, and you can find more details in the [variable reference](https://docs.airbyte.com/platform/connector-development/config-based/understanding-the-yaml-file/reference#variables).