I have this response from an API that I’m triggering into the Api section into fresh bot designer.
Is there a way to list all the values like in a list or similar with all the values that are inside of each position of the array?
In some other dialogs I’m doing name.0.value to display the value of name on position 0 but in some cases I wan to show all the results in a dialog If I do result does not show anything .
I don’t think the bot supports looping today. What I have done in the past is if there are lets say 4 max options, I will check in conditions if result.1.contract=null, go to a dialog which only has the result.0.contract placeholder.
If result0 and result1 = not null but result2 = null, go to a dialog which displays results and result1
Its a workaround till the product supports looping through the values. And it isn’t scalable, works with 4-5 max options
ok will tra y to setup something and check on this but it’s a valid workaround for now.
Anyway I was thinking that If I do display in the dialog with lets says result.0 till 10 the ones that are null will not display anything right? and the ones that has values will display it is that right?
So we can say that we display till a maximum of 10 contracts per customer which is very rare for insurance that a customer has more than 2 or 3 .
I’ve also tried for a specific value into a specific field, asked if it’s ’ ’ (empty) for example result.0.contract equals ’ '.
Could you please let me know if you think a better way so I can accomplish this?
The idea is to ask if the next element if present so I display it and if it’s not I jump to a different dialog.