<@U04SE163WC8> I am using no code connector builde...
# ask-ai
s
@kapa.ai I am using no code connector builder for a stream which is a POST endpoint and accepts start_date and end_date in the form of a list in the json Payload. e.g. "order_date":[start_date, end_date] . How do I configure the incremental sync so that the start_date and end_date dynamcally in this list?
u
To configure incremental sync for your POST endpoint that accepts start_date and end_date in a list within the JSON payload, you can use custom parameter injection in the Airbyte Connector Builder. Here's how you can approach this: 1. In the incremental sync configuration, disable the default injection for start and end times. 2. Instead, use the generic parameter section at the bottom of the stream configuration form to set up your custom JSON body. 3. You can use Jinja expressions and available variables to dynamically inject the start and end times into your JSON body. Here's an example of how you might configure this: 1. In the "Incremental sync" section of the Connector Builder UI, set up your cursor field and datetime format as usual, but don't use the default injection options. 2. In the generic parameter section, add a new parameter for your request body: - Set "Key" to "body" (or whatever your API expects) - Set "Value" to a Jinja expression like this:
Copy code
json {   "order_date": ["{{ stream_interval.start_time }}", "{{ stream_interval.end_time }}"] }
This approach uses the
stream_interval
variable, which provides access to the current time slice for incremental syncs. The
start_time
and
end_time
properties of this variable will be dynamically populated with the appropriate values for each request. Remember that the exact format of your dates should match what your API expects. You might need to adjust the datetime format in your incremental sync configuration to ensure this. For more details on custom parameter injection and available variables, you can refer to the [Airbyte documentation on custom parameter injection](https://docs.airbyte.com/connector-development/connector-builder-ui/incremental-sync#custom-parameter-injection). If you need more complex logic or formatting for your dates, you can use Jinja's built-in filters and functions within your expression to manipulate the date strings as needed.
s
@kapa.ai this is the expected payload, please transform this into the aforementioned answer:
Copy code
{
  "filters": {
    "order_date": [
      "2024-10-01",
      "2024-10-20"
    ]
  }
}
u
A message from kapa.ai
u
To configure incremental sync for your POST endpoint that accepts start_date and end_date in a list within the JSON payload under "filters", you can use custom parameter injection in the Airbyte Connector Builder. Here's how you can approach this: 1. In the incremental sync configuration, disable the default injection for start and end times. 2. Instead, use the generic parameter section at the bottom of the stream configuration form to set up your custom JSON body. 3. You can use Jinja expressions and available variables to dynamically inject the start and end times into your JSON body. Here's an example of how you might configure this: 1. In the "Incremental sync" section of the Connector Builder UI, set up your cursor field and datetime format as usual, but don't use the default injection options. 2. In the generic parameter section, add a new parameter for your request body: - Set "Key" to "body" (or whatever your API expects) - Set "Value" to a Jinja expression like this:
Copy code
json {   "filters": {     "order_date": ["{{ stream_interval.start_time }}", "{{ stream_interval.end_time }}"]   } }
This approach uses the
stream_interval
variable, which provides access to the current time slice for incremental syncs. The
start_time
and
end_time
properties of this variable will be dynamically populated with the appropriate values for each request. Remember that the exact format of your dates should match what your API expects. You might need to adjust the datetime format in your incremental sync configuration to ensure this. For more details on custom parameter injection and available variables, you can refer to the [Airbyte documentation on custom parameter injection](https://docs.airbyte.com/connector-development/connector-builder-ui/incremental-sync#custom-parameter-injection). If you need more complex logic or formatting for your dates, you can use Jinja's built-in filters and functions within your expression to manipulate the date strings as needed.