BuildShipBBuildShip
Powered by
Ryan AR
BuildShip•2y ago•
4 replies
Ryan A

Updating target firestore doc with timestamp from another table

I receive a firestore timestamp field in a changed row - I am trying to write that value out (as is) to a different firestore document using the Firestore Create Document node.

The
inboundDateTime
inboundDateTime
that I am received is in this format (which I believe is Firestore timestamp... and can't work out how to parse and use to update target document!

"createdDateTime":{
  "_nanoseconds":550000000
  "_seconds":1720261349
}
"createdDateTime":{
  "_nanoseconds":550000000
  "_seconds":1720261349
}


___
Try 1:
targetDateTime: (x)Row.inboundDateTime
targetDateTime: (x)Row.inboundDateTime


Try 2:
targetDateTime: (x)Row.inboundDateTime.toDateString()
targetDateTime: (x)Row.inboundDateTime.toDateString()
...as well as
toDate()
toDate()


Return: ...stating
ctx.root.rowy-trigger.row.inboundDateTime.toDateString is not a function
ctx.root.rowy-trigger.row.inboundDateTime.toDateString is not a function

Return: ...stating
ctx.root.rowy-trigger.row.inboundDateTime.toDate is not a function
ctx.root.rowy-trigger.row.inboundDateTime.toDate is not a function


Try 3:
I have seen examples of formatting the date in Javascipt before returning - but cannot work out where to inject that JS code as the Firestore Update Document node ('data' parameter') appears to just want a {field1: vale, field2: value} code block.

(Idea influenced by https://discord.com/channels/853498675484819476/1173147442661818368)

Any ideas?
BuildShip banner
BuildShipJoin
Join founders, builders, devs using Low-code / No-code to create backend, APIs, scheduled Jobs, automation, AI workflows
7,971Members
Resources
Recent Announcements

Similar Threads

Was this page helpful?

Similar Threads

FlutterFlow Streaming Assistant with Firestore
raj patelRraj patel / ❓・buildship-help
2y ago
How to Query Firestore document using a field which is of type timestamp
Chinmay KhandelwalCChinmay Khandelwal / ❓・buildship-help
8mo ago
Firestore node - Edit Document - From array to map
AntoineAAntoine / ❓・buildship-help
5mo ago
Filtering a Firestore call with OR condition
JamesGJJamesG / ❓・buildship-help
2y ago