Skip to main content

Currently I’m trying to build Telegram-bot from the constructor. I do API request to one service using Action “External Request”, I get data like this:
 

-
{
"id": 1,
"entities_id": 0,
"is_recursive": 0,
"name": "Company 1",
"comment": "",
"ldap_field": null,
"ldap_value": null,
"ldap_group_dn": null,
"date_mod": "2024-01-31 16:31:44",
"groups_id": 0,
"completename": "Company 1",
"level": 1,
"ancestors_cache": "c]",
"sons_cache": null,
"is_requester": 1,
"is_watcher": 1,
"is_assign": 1,
"is_task": 1,
"is_notify": 1,
"is_itemgroup": 1,
"is_usergroup": 1,
"is_manager": 1,
"date_creation": "2024-01-31 16:31:44"
},
{
"id": 3,
"entities_id": 0,
"is_recursive": 0,
"name": "Company 2",
"comment": "",
"ldap_field": null,
"ldap_value": null,
"ldap_group_dn": null,
"date_mod": "2024-02-07 17:48:06",
"groups_id": 1,
"completename": "Company 1 > Company 2",
"level": 2,
"ancestors_cache": "{\"1\":1}",
"sons_cache": null,
"is_requester": 1,
"is_watcher": 1,
"is_assign": 1,
"is_task": 1,
"is_notify": 1,
"is_itemgroup": 1,
"is_usergroup": 1,
"is_manager": 1,
"date_creation": "2024-02-07 17:48:06"
},
{
...
}
]

Then I need to create a question, where the choices are the name’s attributes’ values from those data. A question with multiple choices. And I need to create it dynamically. I mean, if I have 79 entities, then there’ll be 79 choices (values of name’s attributes), if I have 50, then there’ll be 50.
 

What I do now is trying to save these array data into custom user field “group_array” in Response Mapping. custom user field “group_array” is a user field that I’ve created in Settings. It seems like I can use it in Response Mapping:

$ →group_array

But when I want to display the value of the variable, I mean just “Send Message” Action, I use {}, but there’s no such variable. And I don’t understand why…

 

Here are the screenshots:

 

Hey ​@denis_ka this is a tricky one, and I'm don't think you'll be able to solve it the way you're doing it.

I'd try with Dynamic Requests (https://help.manychat.com/hc/en-us/articles/14281268533788-DevTools-Dynamic-block) and sending the content ready to be printed out.

You'll probably have to add something in between (Make or your own code) to give the content the format you want.

Hope this helps!


Hey ​@denis_ka this is a tricky one, and I'm don't think you'll be able to solve it the way you're doing it.

I'd try with Dynamic Requests (https://help.manychat.com/hc/en-us/articles/14281268533788-DevTools-Dynamic-block) and sending the content ready to be printed out.

You'll probably have to add something in between (Make or your own code) to give the content the format you want.

Hope this helps!

Thanks! By the way, is there any possible way to save data (array) from GET-request into a custom user field and then use it?


Hey ​@denis_ka this is a tricky one, and I'm don't think you'll be able to solve it the way you're doing it.

I'd try with Dynamic Requests (https://help.manychat.com/hc/en-us/articles/14281268533788-DevTools-Dynamic-block) and sending the content ready to be printed out.

You'll probably have to add something in between (Make or your own code) to give the content the format you want.

Hope this helps!

And.. how can I use Content, that I’ve got from Dynamic Requests? There’s no instructions about it.


Hey ​@denis_ka this is a tricky one, and I'm don't think you'll be able to solve it the way you're doing it.

I'd try with Dynamic Requests (https://help.manychat.com/hc/en-us/articles/14281268533788-DevTools-Dynamic-block) and sending the content ready to be printed out.

You'll probably have to add something in between (Make or your own code) to give the content the format you want.

Hope this helps!

And, btw, by any chance can I do like: i make GET-request, I get an array of 10 entities, can I put the names of entities to Quick Responses in Multiple Choice action? I dunno, maybe with using the variable somehow?


You can use External Requests to store data: https://help.manychat.com/hc/en-us/articles/14281285374364-Dev-Tools-External-request

And Dynamic Content to display content in the chat application (you cannot store data in Dynamic Content requests).

And no, I don't think you can store content in Array variables - the array variable has to be managed by the API - That's the only useful way I found to make use of it.


Reply