Firestore field update is overwriting instead of appending – WhatsApp AI chat history

I’m building a WhatsApp AI assistant using Make.com + OpenAI + Google Cloud Firestore.

The goal is to save the full conversation history in a single field inside Firestore, appending each new interaction.


:cross_mark: Problem

Each time a new message is sent, the Firestore field conversa is overwritten instead of being appended.

Even when I fetch the document (Get a Document) and use this logic in the Tools module:

make

CopiarEditar

{{37.fields.conversa}} & "\n[" & formatDate(now; "dd/MM/yyyy HH:mm") & "] Lead: " & {{mensagemLead}} & "\nIA:"

The database ends up saving only the new message, erasing the previous history.


:white_check_mark: What I tried

  • Confirmed the field exists and comes with value from Get a Document
  • Switched from .stringValue to direct access fields.conversa
  • Removed any filters or conflicting modules
  • Compared with another scenario (message dispatcher), which appends correctly
  • Tried to debug via Tools output — variable has the correct value
  • Tried long text field in Firestore (no change)
  • Attempted alternative write logic with Create/Update Document
  • Tried mapping manually from JSON structure
  • Video recorded showing the issue (I can upload on request)

:brain: Question

Is there any known bug or edge-case behavior with Firestore + Update a Document when appending string fields?

Should I use a different pattern to update long text fields reliably?

Welcome to the Make community!

To update while appending older data, you first need to fetch the current record and prepend the older field’s data before the new data.

Hope this helps! Let me know if there are any further questions or issues.

@samliew

P.S.: Investing some effort into the Make Academy will save you lots of time and frustration using Make.