<@U04S8PLJWMT> i'm building low_code custom connec...
# ask-ai
h
@kapa.ai i'm building low_code custom connector, with start_date, i'm giving incremental sync as %s, how to get start_date from user, the fomrat is %s
k
To allow the user to provide a
start_date
for incremental sync when your cursor format is
%s
(UNIX timestamp), you should: 1. Define
start_date
as a string in your connector's spec
(so the user can input it). 2. Convert the user input to a UNIX timestamp if the user provides a human-readable date (e.g.,
2023-06-11
). You can use Jinja templating to format the input as needed. 3. Set the
datetime_format
for the cursor to
%s
in your
incremental_sync
configuration. Here’s an example configuration for a low-code connector using a UNIX timestamp as the cursor:
Copy code
yaml incremental_sync:   type: DatetimeBasedCursor   cursor_field: "created"   datetime_format: "%s"   cursor_granularity: "PT1S"   start_datetime:     datetime: "{{ config['start_date'] }}"     datetime_format: "%s"   end_datetime:     datetime: "{{ now_utc().timestamp() | int }}"     datetime_format: "%s"   step: "P1D"   start_time_option:     field_name: "created_after"     inject_into: "request_parameter"   end_time_option:     field_name: "created_before"     inject_into: "request_parameter"
- In your
spec
, define
start_date
as a string. The user should provide the value as a UNIX timestamp (e.g.,
1686441600
for
2023-06-11T00:00:00Z
). - If you want to allow the user to input a human-readable date, you would need to convert it to a UNIX timestamp using Jinja or in your connector logic. Reference: This approach is based on the example provided in the Airbyte forum, where
%s
is used for UNIX timestamps and the user provides the
start_date
in the same format. See the [forum post on handling UNIX timestamps with Low-Code CDK](https://discuss.airbyte.io/t/3921) for more details. If you need to support user input in a different format (e.g., ISO date), you would need to convert it to a UNIX timestamp before using it as
start_date
. The knowledge sources do not provide a built-in way to do this conversion automatically in the manifest, so you may need to instruct users to provide the timestamp directly or handle the conversion in your connector logic.