Need help saving responses to buttons in Telegram bot

Hi! I would be grateful for your help.

I am reaching out to ask for help with a problem I encountered while creating a bot for calculating taxes in Poland using the n8n platform.

My bot interacts with the user through a series of questions regarding their status, citizenship, residency, contract type, and income. However, I am having trouble saving all the answers when the user selects options using buttons. Instead of saving all the answers to each question, the bot only saves the last selected answer.

For example, if I select the following options:

Status: Freelance

Citizenship: Ukraine

Residency: Resident

Contract type: B2B

Income: PLN 3000-5000

And then I select the option:

Status: Student

Citizenship: Other

Residency: Non-resident

Contract type: (empty field)

Income: 3000-5000 PLN

Then, in the end, only the last answer is saved (in this case, the status “Student,” etc.), and not all the selected options.

I have already tried several approaches, but so far I have not been able to solve this problem. Perhaps you can advise me on how to correctly save all selected button options in order to generate the final result based on these answers.

I would like to note that the bot processes data and saves it in Google Sheets for further tax calculation and providing the final answer. The bot also supports two languages — Polish and Ukrainian — and uses built-in keyboards to interact with the user.

I would be grateful for any help or recommendations.

I have another version of the bot in which I want to implement a process where the user first subscribes to a Telegram channel with news and then proceeds to calculate taxes. However, I encounter a problem when, after subscribing to the channel, the bot sends a message asking to start the calculation, but the calculation process itself does not take place.

Instead, another message comes asking to subscribe to the channel, and this repeats in a loop — the bot does not proceed to the calculation stage

I checked the settings and the subscription process, but the problem persists. Perhaps you could advise me on how to configure the logic so that after subscribing to the channel, the user can immediately proceed to the calculation without repeating the cyclical messages.

I would be grateful for your help or advice on this matter.

(In the second scenario, where the channel subscription is checked, I disabled the subscription stream because I don’t know where to connect it correctly.)

Sincerely, Daria

You are assigning a new sessionData.data object, instead of merging it with the existing data.
Try to Merge the old sessionData.data with the new values using Object.assign() or the spread operator ....

Hi Daria,

Based on my experience with similar Telegram automations, the issue usually comes from every button writing to the same field so each new answer overwrites the previous one.

A quick way to fix this in n8n:

  1. In every Telegram node that sends the question, set a unique Property Name (for example status, citizenship, residency, contractType, income).
    1. After each question, use a Set node to store the answer in a separate variable like item.status, item.citizenship, and so on.
    1. When all questions are done, use a Merge node (Combine mode) to join the items so you end up with one object that contains all answers.
    1. Finally send or save that object to your database, Google Sheet, or wherever you need it.
      In a recent build we moved a five-question flow to this structure and captured every answer correctly in under an hour.

First small step: clone your existing workflow, rename the Property Name for the first two questions, and confirm both answers are saved—then apply the same pattern to the rest.

Strategic question: once you have the data, what downstream process should it trigger (e.g. tax calculation, report generation, CRM update)? Knowing that will help choose the best storage and follow-up nodes.

Hope this helps—let me know how the test run goes.

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