-
My goal:
I want to automatically populate thecreated_at
timestamp when a form is submitted in Retool, and insert that value into a BigQuery table using the GUI (not raw SQL). -
Issue:
Even though I'm trying to pass a timestamp, the value is being sent to BigQuery as[object Object]
, which causes an error likeInvalid timestamp: '[object Object]'
. -
Steps I've taken to troubleshoot:
- Tried using this expression in the value field:
{{ { RT$BQ_TYPE: "TIMESTAMP", value: new Date() } }}
- Tried formatting the datetime as an ISO string:
{{ new Date().toISOString() }}
- Also tried using a JavaScript query (
get_current_time
) that returns the current timestamp in ISO format (toISOString()
), and referencing it via{{ get_current_time.data }}
- When I use
RT$BQ_TYPE
directly in the GUI insert query, the object sometimes gets passed as a string instead of a native timestamp.
- Additional info:
- Retool Cloud
- Using GUI mode for database inserts (not raw SQL)
- I'm inserting into BigQuery, and the
created_at
field is of typeTIMESTAMP