Hello!
I’m a beginner and still not very familiar with the Make platform, so I might be doing something wrong.
Goal:
I want my Telegram bot to send a single message containing multiple inline keyboard buttons, arranged in multiple rows.
The number of buttons per row can vary depending on the context. For example:
In one row: 1 button (full width),
In the second row: 2 buttons,
In the third row: 2 buttons again,
In the fourth row: 1 button
Important detail:
The data for the buttons is dynamically pulled from Google Sheets, so the number of buttons can be N and can change.
I need all these buttons to be sent in one single message, not as multiple messages.
My current approach: I use the Google Sheets - Search Rows module to get the data for the buttons. Then I use an Array Aggregator module to group the buttons. After that, I use the Aggregate to JSON (or JSON) module to build the JSON object for the inline_keyboard.
The problem:
The output ends up being a structure with multiple arrays (each row is a separate array), and the Telegram API sends them as separate messages (each array = separate message), not as a single one.
If I try to merge them all into a single array, Telegram sends them all in a single row.
I’ve tried different combinations of Array Aggregator and JSON modules, but Telegram doesn’t accept the final result and often returns: [400] Bad Request: can't parse reply keyboard markup JSON object
Question:
How can I properly build a JSON object with an inline_keyboard in Make, so that: The data is dynamically pulled from the table (Google Sheets), I get a single JSON object with buttons spread across multiple rows (1 button in some rows, 2 in others, etc., as in the example), And Telegram accepts it and sends all buttons in one message?
If anyone has a working example of such a scenario in Make, could you please share it?
Neat use case! At Hashlogics, we’ve been actively working with dynamic Telegram UIs, so thought I’d chime in.
For what you’re trying to achieve, the trick is structuring inline_keyboard as an array of arrays, where each sub-array is a row of buttons. Telegram expects this nested structure, even if the data is dynamic.
If your aggregator is giving you multiple separate arrays, try using a custom JSON builder (or even a simple code module) to manually control the row layout like this:
This lets you send all rows in a single message. We’ve been exploring similar flows lately with dynamic button generation tied to Google Sheets and AI prompts, so happy to share more if you get stuck!
@Hashlogics
Hi, thank you for your suggestion!
The approach makes sense, but I have one important constraint:
The number of buttons is dynamic — they are pulled from a Google Sheet, and the amount can change every time.
Sometimes there are 3 buttons, sometimes 7, sometimes even 12+.
That’s why I’m specifically looking for a fully dynamic solution, where the grouping into rows (e.g. 2 buttons per row) happens automatically, without hardcoding JSON rows manually.
What I’m trying to achieve:
Loop through the dynamic list of buttons
Group them into rows of 2 (last row can have 1 if needed)
Build the final inline_keyboard JSON
All of this should happen automatically inside Make, without needing to predefine the layout
Any working example, suggestion, or JavaScript snippet inside Make would be super helpful!
Thanks in advance!
Hope this helps! Let me know if there are any further questions or issues. P.S.: investing some effort into the tutorials in the Make Academy will save you lots of time and frustration using Make!
@samliew
Hi, thank you so much for sharing your custom Chunk Array module — it’s a great idea and I really appreciate your contribution!
I’ve been trying to use it to split a list of Telegram inline keyboard buttons into multiple rows (e.g. 2 buttons per row). The module does produce a nested array like this (output simplified):
So I think the issue is that the elements inside each sub-array are stringified JSON, not real objects.
I tried a few things inside Make:
using Parse JSON inside an Iterator
using Create JSON after chunking
But I couldn’t get the result Telegram accepts — maybe I’m missing something or misapplying the tools.
For reference, I’m attaching two screenshots that hopefully help illustrate the issue more clearly:
First screenshot – Array Aggregator output:
You can see that each button is a proper JSON object with fields like text and callback_data. This structure looks clean and valid, but it’s not grouped into rows, so I’m not sure how to prepare it for Telegram’s inline_keyboard format (which expects an array of arrays).
Second screenshot – Chunk Array output:
This one does split the array into chunks (2 per row), which is great! But the problem is that the items inside each chunk are stringified JSON — not actual objects. That seems to be why Telegram doesn’t render them.
If you have any tips on how to convert those strings into actual objects, I’d be really grateful!
One more option would be to use a Text Parser module, but that’s very advanced stuff.
Hope this helps! Let me know if there are any further questions or issues. P.S.: investing some effort into the tutorials in the Make Academy will save you lots of time and frustration using Make!