How do I create a firestore document

Problem:

I only want the stuff inside the “formatted” object in the root of the document. How do I reference it inside the firestore db node.

I tried using the key json in the columns/Attributes section but to no avail…

Information on your n8n setup

  • n8n version: 1.118.2
  • Database (default: SQLite): Postgres
  • n8n EXECUTIONS_PROCESS setting (default: own, main):default
  • Running n8n via (Docker, npm, n8n cloud, desktop app): Docker
  • Operating system: Windows Laptop (local machine with Docker)
1 Like

Hi @Punosie instead of formatted in the columns/attribute field try this:
{{ Object.keys($json.formatted).join(',') }}

So that it actually extracts it from the previous node, as currently what you have used fetches a list which causes the error, make sure what you are fetching is actually readable string not a list or couple of objects.

Hi @Punosie

I’ve seen this error before, is a pretty common issue with the Firestore node. In this case, the problem is that the “Columns / Attributes” field is being used in the wrong way.
What works better for me is using the Add Field option instead, or restructuring the data so I’m not passing the formatted wrapper and instead sending the fields directly at the root level.

2 Likes

Its sending their values as null

Doing it like this worked… Thanks !

2 Likes

uhuu :tada:
Happy to help!

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.