Using dynamic input in Connector Builder UI for setting current date in API request

Summary

User is looking for a way to use dynamic input like date_time.today() in Connector Builder UI to set the current date in an API request for a connector being built.


Question

Hi, I am building a connector using the connector builder UI - is there a way of using a dynamic input such as date_time.today() either in the request body or the user input?
The api asks for a end date and I would like to set this as the current date.



This topic has been created from a Slack thread to give it more visibility.
It will be on Read-Only mode here. Click here if you want to access the original thread.

Join the conversation on Slack

["connector-builder-ui", "dynamic-input", "current-date", "api-request"]

Hey :wave:

I believe interpolation macros is something that can help. Check out this article for the examples: https://docs.airbyte.com/connector-development/config-based/understanding-the-yaml-file/reference/#/macros/Now%20(UTC)

Yup, should work perfectly! Here’s my quick test

yes thanks <@U06UKF6KL15> that’s great - I just wonder whether it is possible to have a user input defaulting to such an expression? I tried to use it as such but it doesn’t work. What I would like to achieve is that a default value such as
{{day_delta(-1,)}} would be set as a user input but that this can be overwritten by a user

Hmm, yeah, for me it also doesn’t work as the user input through the default value, only when the macros is used as the value in the query param :confused: Probably this is not supported yet

Maybe, as a workaround, you can configure two query parameters - one with macros and another one with a user input value? Since query params are optional, you can switch between them when there’s a need