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: