Trigger body with foreach #1836
Replies: 6 comments 3 replies
-
No, for buttons you can't do that, only for text message. So you will have to format in your end. |
Beta Was this translation helpful? Give feedback.
-
Thank you Remdex. Please guide me with one more thing. Do I move this discussion, to Ideas (possible improvement for LHC native module), Q&A (since it's a simple answer) or leave it right here? I will treat in the end as you said |
Beta Was this translation helpful? Give feedback.
-
I had thought about the comma issue so after closing the forche it passed {}
I was wondering if it would be some implementation with {{}} doubles or "{foreach}" but still without success I'll try some other idea and post again here. |
Beta Was this translation helpful? Give feedback.
-
That's what I thought! So I leave you with a suggestion for future versions, to create an Enter JSON box in Send Text. So we can use foreach natively in the LHC or an implementation in Quick Reply to use the API return. Enter HTML would even be possible to use if I managed to pass the Store Name (it is possible and I don't know)? |
Beta Was this translation helpful? Give feedback.
-
It has to be quick reply syntax not HTML in order for the So I ques you will have to generate proper content in your Rest API. It's possible to develop this custom foreach which would apply only in trigger context, but would take 2-3 hours. If you are willing to develop it yourself correct place is here https://github.com/LiveHelperChat/livehelperchat/blob/master/lhc_web/lib/core/lhgenericbot/actionTypes/lhgenericbotactiontbody.php#L10 Or you can always sponsor development :) |
Beta Was this translation helpful? Give feedback.
-
Thank you for giving me the knife and cheese, now I'm going to cut it hahaha remdex, thanks for your attention, I'll do it here and send it for your approval. And you can be sure that soon I will sponsor the development of some improvement/functionality Or worst case sponsor some beers and a supply of coffee LOL |
Beta Was this translation helpful? Give feedback.
-
it is possible to use foreach, in the
Triggerbody?
I wanted/imagined doing something like this:
[ { "type": "text", "content": { "text": "Please select the ID number.", "quick_replies": [ {foreach=content_1} {, "type": "trigger", "content": { "name": "{var_forache}", "payload": "278", "store_name": "var_storene_nem", "store_value": "{var_forache}" } }, {/foreach} {} ] } } } ]
I want to use foreach to assemble a list of buttons incremented by the API return natively by the LHC, without the need to do this treatment in the API
Is everything native through the LHC possible?
Beta Was this translation helpful? Give feedback.
All reactions