Skip to main content
Solved

How to Dynamically Display an Array as Telegram Buttons


Hey,
Does anyone know how to display an array (text type) as buttons in Telegram?

For example, this is the response I receive:

I managed to save all the curtains in the contact's database, and so far, everything is working great.
Now, I want to give the user a button in Telegram for "Green Curtain" and another button for "blue curtain" (this should dynamically change based on the received response).

Does anyone know a way to do this?

 

{ "status": "success", "response": { "curtains": [ "Green curtains", "blue curtains" ] } }

Best answer by Gustavo Boregio

@AmitShemla you have 2 options:

  1. you map these options to user fields and use that in the button labels (this is the easiest way)
  2. You use Manychat’s API, with the sendContent endpoint: https://api.manychat.com/swagger#/
View original

Gustavo Boregio
Forum|alt.badge.img+6

@AmitShemla you have 2 options:

  1. you map these options to user fields and use that in the button labels (this is the easiest way)
  2. You use Manychat’s API, with the sendContent endpoint: https://api.manychat.com/swagger#/

Hi ​@Gustavo Boregio and thank you so much for your help!

Can you tell me how to do number 1?

In the response mapping i have added this:
$.response.cutains[*] and i can see under the contact “curtains” field (type=array) the list of curtains which is great

now i am trying to show them as buttons but now sure how since when i am adding “new message” with telegram and add a button, i can dynamicly put the array field but it’s not creating few nuttons and not shwing anything since it’s expecting 1 text (as i understand)

 

THANKS

 


Gustavo Boregio
Forum|alt.badge.img+6

@AmitShemla you'll need to map them to 2 different user fields, with the following JSONPaths:

 

As far as I know you will not be able to map them to an array or use the array in your automations.


Alex zach
  • Up-and-Comer
  • March 10, 2025

Good 😊 


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings