Hi!
I’m working with Firebase Firestore and have created a document with an autogenerated ID. Now, I need to update this document via make.com, but I’m not sure how to correctly reference it given that I don’t have the ID stored.
Could someone explain the best approach to update a Firestore document when the document ID was autogenerated? Is there a way to retrieve and update this document directly, or should I always work with a known ID?
If you have a Firestore document ID you can use it in subsequent modules.
If you need it in separate scenarios you’ll need to store that ID or find a way to search for it using some other identifying information about the document.
I have the firestore ID saved in a sheets document. I search the document and find it, but when I use the maping toggle and enter the firestore ID as a variable pulled from the google sheets the document doesnt gets updated. It gets duplicated with just the fields I updated. So now I have two records with the same ID.
I also tried to add the field in the delete section to force the “update document” but no to no avail.
When it get duplicated its a different document id correct? I’m suspecting something within the document path name is not being copied or mapped exactly the same.
Try under “Input document path” change that to mapping and enter in the full path.
I agree. I cant figure it out because I try comparing the input for both way(mapping it and using the dropdown) and it all looks the exact same.
Nonetheless when I map it, it seems to create a new document instead of updating the existing one. In the screenshot the IDs are the exact same.
There is a difference between the two ids. The j in one is capitalized and the other lowercase. Your issue might be steming from the step you are recording the document ID into the Google Sheets.
Oh wow. Such a rookie mistake. I asked Chatgpt to transcribe the IDs from firebase for my document and there were some mis matched. Thank you for catching that! the mapping worked fine after that!