Live Helper Chat support forum.. Forum is locked. New place for questions - Github Discussions
You are not logged in.
Pages: 1
Good morning, I am getting data from an api, in this way:
{
"emails": {
"email1": "***.com",
"email2": "***.com"
},
"status": "success"
}
From a bot and in the "Send Text" option and with the help of foreach it prints me correctly.
{foreach=content_1}
- {args.item}
{/foreach}
How could I access the mail "email 1" without being in a foreach? I have tried things like:
After using "update current chat" -> Set chat variable [not visible by operator] -> {"emails":"{content_1}"}
{args.chat.chat_variables_array.emails.0}
{args.chat.chat_variables_array.emails.*}
{args.chat.chat_variables_array.emails:email1}
{args.chat.chat_variables_array.emails.email1}
{args.chat.chat_variables_array.emails.0.email1}
But I have not been successful, could someone guide me. Thanks in advance.
Last edited by karlitoxz (2022-08-03 20:42:57)
Offline
You should use that syntax in output parsing in your rest api call just. Afterwad it would
be like content_1 or content_2
Offline
Ok remdex, what happens is that I already have the other "content_x" used by other data that comes from that same API; This is why I was looking at how to use the first "content_1" as an array but use the data without the help of a foreach
the idea I have is to use the first email "email1" to store the original email and the other to obfuscate the email "email2" and display it in the bot but masked "***.com"
Offline
I see your point. I ques the only way to do it would be extend Rest API call. So there would be something like content_1_array.xxx support. You can try actually extend lhc, I would accept pull request for that. As I’m in holidays not much I can do now, in amy case it would be just paid improvement for a few hours…
Offline
Pages: 1