dbrwk
dbrwk3mo ago

Object Validation node returns Unsupported type: timestamp error

Hi, trying to create firestore doc via api call based on this video https://www.youtube.com/watch?v=9-RCaOhz_eE. the main workflow works. but i want to add "created_at" field. In validation part i have { field: 'created_at', required: false, type: 'timestamp' }, and my body json is like "created_at": "2024-07-05T02:08:55.000Z", even if i change it into actual timestamp like this - still not working "created_at": 1720122473, Whit such config, the object validation node returns an error: Unsupported type: timestamp Any idea how i can put actual timestamp to my firestore doc?
BuildShip
YouTube
Firestore CRUD with no code - visual workflow builder
Get started at https://buildship.com This video shows how you can use BuildShip's built in Firestore. If you want to use your own Firestore then simply follow these short steps to connect to your Firebase https://docs.buildship.com/tutorials/firebase-project Then you can build workflows with Firestore CRUD with ease no code style. 💬 Chat: htt...
3 Replies
Christopher30
Christopher303mo ago
I am using timestamp when updating field values for Firestore documents. In node logic code you could modify the first line to this: import { Firestore, Timestamp } from '@google-cloud/firestore'; then you should be able to get the right time format by using: "created_at": Timestamp.now() //In my case I have coded to update the timestamp value right in the node logic, instead of having it as an input value. Note: I am not a coder myself, I used AI to help me create the code for my node, but it works for me 🙂
dbrwk
dbrwk3mo ago
Cool idea! Thanks! But, just for clarification. In wich node you put this? my workflow is like that: rest trigger -> object validation node -> branch node -> (is success) firestore create doc;
Christopher30
Christopher303mo ago
You should add it to "firestore create doc;"