<@U04S8PLJWMT> Using connection builder i have an ...
# replication-ask-ai
j
@kapa.ai Using connection builder i have an incremental cursor field that is in the format %Y%m%d , however the date time format that it is retrieved is different then the outgoing format. It is storing the cursor as: { "streamDescriptor": { "name": "ADSP_CAMPAIGN" }, "streamState": { "intervalStartDT": "20251001" } } ] I have the start date set to 20251001 so it appears the cursor is not being set . Do I need to set the stream start in the "Start" date time? currently i only have "{{ config['start_date'] }}"
k
The knowledge sources describe how datetime cursors work in general, but they don’t show the exact internal JSON state format you pasted, so I can’t be 100% certain about your specific connector. I’ll stick to what is documented. Key points from the docs: - The cursor field is read from each record, parsed using the cursor datetime formats, and the last record’s cursor value becomes the new state for the next sync. [[Incremental sync builder](https://docs.airbyte.com/platform/connector-development/connector-builder-ui/incremental-sync); [DatetimeBasedCursor ref](https://docs.airbyte.com/platform/connector-development/config-based/understanding-the-yaml-file/reference#/definitions/DatetimeBasedCursor)] - The Start datetime is only the initial lower bound. On subsequent syncs, Airbyte replaces it with the last cursor value; you don’t manually update it. [[Incremental sync builder](https://docs.airbyte.com/platform/connector-development/connector-builder-ui/incremental-sync)] - The outgoing datetime format (what you send to the API) can be different from the cursor datetime formats (how the cursor field appears in the records). [[Advanced settings](https://docs.airbyte.com/platform/connector-development/connector-builder-ui/incremental-sync#advanced-settings); [DatetimeBasedCursor ref](https://docs.airbyte.com/platform/connector-development/config-based/understanding-the-yaml-file/reference#/definitions/DatetimeBasedCursor)] Given that: 1. You do not need to hard‑code the last cursor into “Start datetime”. “Start datetime” should be your initial start (e.g.
{{ config['start_date'] }}
), and after the first successful sync, Airbyte should use the last record’s cursor value instead. [[Incremental sync builder](https://docs.airbyte.com/platform/connector-development/connector-builder-ui/incremental-sync)] 2. To make sure the cursor is actually updated, check these in the Connector Builder: - Cursor field: set to the field in the records that contains
20251001
(e.g.
intervalStartDT
). [[Incremental sync builder](https://docs.airbyte.com/platform/connector-development/connector-builder-ui/incremental-sync)] - Cursor datetime formats: include
%Y%m%d
as one of the formats so Airbyte can parse
20251001
. [[DatetimeBasedCursor ref](https://docs.airbyte.com/platform/connector-development/config-based/understanding-the-yaml-file/reference#/definitions/DatetimeBasedCursor); [Next ref](https://docs.airbyte.com/platform/next/connector-development/config-based/understanding-the-yaml-file/reference#/definitions/DatetimeBasedCursor)] - Outgoing datetime format: can be something else (e.g.
%Y-%m-%d
), that’s fine; it only affects what’s sent to the API, not how the cursor field is parsed. [[Advanced settings](https://docs.airbyte.com/platform/connector-development/connector-builder-ui/incremental-sync#advanced-settings)] 3. If the state always shows the original
20251001
and never advances, the most likely documented causes are: - The cursor field is not correctly set (Airbyte isn’t reading that field as the cursor). [[DatetimeBasedCursor ref](https://docs.airbyte.com/platform/connector-development/config-based/understanding-the-yaml-file/reference#/definitions/DatetimeBasedCursor)] - The cursor datetime format doesn’t match the actual value, so parsing fails and the cursor can’t be advanced. [[DatetimeBasedCursor ref](https://docs.airbyte.com/platform/connector-development/config-based/understanding-the-yaml-file/reference#/definitions/DatetimeBasedCursor)] So, you should: - Keep
Start datetime
as
{{ config['start_date'] }}
(with
start_date
initially
20251001
). - In the incremental settings, explicitly add
%Y%m%d
to Cursor datetime formats and confirm the Cursor field is the correct top‑level field. - Leave the Outgoing datetime format as whatever your API needs; it doesn’t have to be
%Y%m%d
. If after that the cursor still doesn’t move, the docs don’t provide more detail on debugging the internal state representation, so I can’t say more from the available sources.