How can use query parameters having different valu...
# ask-ai
h
How can use query parameters having different values for different orgunits, different data elements and different periods
k
To use query parameters with different values for different orgunits, data elements, and periods in Airbyte's Connector Builder, you should use the partitioning feature, specifically the Parameterized Requests and/or Parent Stream partition components. How to achieve this: 1. Static Partitioning (Predefined or User Input): - You can define the values for orgunits, data elements, and periods as static lists or allow the user to input them as arrays when configuring the source. - For each parameter (e.g., orgunit, data element, period), you can create a user input of type array and reference it in the Parameterized Requests component. - Use the "Current Parameter Value Identifier" to assign a variable name for each parameter, which you can then inject into the request as a query parameter or into the URL path using Jinja expressions like
{{ stream_partition.<identifier> }}
. - If you need to combine multiple values (e.g., orgunit and period together), you can use custom parameter injection with Jinja to construct the query parameter as needed. 2. Dynamic Partitioning (API-provided): - If the list of orgunits, data elements, or periods is provided by the API, use the Parent Stream partition component to fetch these dynamically and inject them into subsequent requests. 3. Custom Parameter Injection: - If you need to combine multiple values or apply custom logic (e.g., concatenate orgunit and period, add prefixes, etc.), disable the default injection and use the generic parameter section at the bottom of the stream configuration form. - Here, you can use Jinja expressions and available variables (like
stream_partition
) to freely configure query parameters, headers, or JSON body properties. For example:
Copy code
yaml      query_parameters:        orgunit: "{{ stream_partition.orgunit }}"        data_element: "{{ stream_partition.data_element }}"        period: "{{ stream_partition.period }}"
- If you need to combine them:
Copy code
yaml      query_parameters:        filter: "{{ stream_partition.orgunit }}_{{ stream_partition.data_element }}_{{ stream_partition.period }}"
- You can also inject these variables into the URL path if required. References: - [Dynamic and static partitioning](https://docs.airbyte.com/platform/1.7/connector-development/connector-builder-ui/partitioning#dynamic-and-static-partitioning) - [Custom parameter injection](https://docs.airbyte.com/platform/1.7/connector-development/connector-builder-ui/partitioning#custom-parameter-injection) If you have a specific API structure or example, you can further customize the parameter injection using Jinja and the available variables as described above.