Firebase Document update won't Update, just do an undefined document, even if it exist

Somehow the Firebase Upset Node won’t do what I want, just make an “undefined” document.



Hi @Official_Berry, welcome to the community!

I believe n8n has tricked you here. Some nodes (mostly database and spreadsheet ones) do require the name/key of a field, not the actual value. The name of the key would need to be identical in both your n8n data and in your Firestore collection. You can rename your n8n fields as needed using the Rename Keys node

A valid operation could look like so:

The result is also visible in the cloud console:

Hope this helps! Let me know if you have any further queries on this.

1 Like

Oh, sooo the Update Key is not the actual vaule, instead of the field name, what comes form the set or whatever node send them… o f… my mistake.

Exactly! And to be fair this isn’t exactly intuitive. If you’re just getting started with n8n you probably would have also seen the data mapping popups showing you how to use the actual values (instead of the field name) :see_no_evil:

Anyway, let me know if you run into any trouble with this :slight_smile:

I have two question:

First can’t I add item to array in existing Firebase document array?

Why do my number value won’t appear? Previously worked.

Hi @Official_Berry, I am not sure just from looking at the screenshot. Is the node perhaps just showing some old data (fi so, simply run it again)? If not, could you share a workflow using which your current problem can be reproduced?


Executed again, no luck. Somehow the number filed missing…maybe a bug?

Okay, so with the screenshot I have an idea as to what is happening here.

You have two branches coming into your Set node (one coming in directly from the Get Organizer Infos Firestore node on your screenshot, one from the SelledTicketQuantity node on your screenshot).

So, your Set node would effectively run twice with what I assume are two different data structures (one which looks as expected by the node and a second very different one which does not produce the result you’re expecting).

To solve this, you’d need to decide whether you need both branches. If so, you can use the Merge node to combine the two different items from different branches into a single item holding all the information. If not, simply delete the connection you don’t need (and update the values in the Set node as needed to suit the remaining branches data structure).

Okay, got it, another two question and I will be done for now:

Some how the add 1 to a number is gives me this result

Another question is the add something to an array (upset)

Hey @Official_Berry, the screenshot shows just the expression rather than the result. On first sight the expression looks good. What does it return?

151 so like add a number to the end of the number, but i found another problem. I cant map a merged infos to the set:


So that looks like a lot to unpack and it seems the Merge nodes all operate in Append mode. Meaning you’ll have more items as your workflow executes. So you are probably looking for a different merge mode, such as Merge by position:

image

Though with that said I am not sure you need all these branches in the first place. They will make it considerably harder to manage your workflow. Seeing your Firestore nodes only fetch individual documents, why not place them sequentially and simply add a Set node after each Firestore node fetching exactly the data you need for the next one?

So my workflow triggered by an api call, then the data comes from the baserow “prepared id-s”, then I need to update 3 different firebase document, then… :D…if conditions split by a value of a organizer field, and then trigger an API call with https requests, I think for me much easier to manage this, when I see all of the data in on table to map them.

Just I can’t do that right now, i stuck here, to collect all of the data to make “Sets”