NOTE: This is an advanced feature and it is not enabled by default. To Enable this feature go to the Settings Page on your home and make sure the Check Box for Enable Data Iteration in Messages, Buttons and Cards is Checked On.

In an API call that you make, sometimes the results come as an array of objects, like the number of restaurants nearby or number of food items available etc. and the number of elements in this Array may not be fixed. This help-doc explains how to display all of that data either in the message bubbles or as options/cards. Here is how you can do that.

Let's say you want to display all the data coming in an array of objects as Buttons. Click on the + icon next to the button. Out of the new icons that will be displayed one will say Data Iteration. Click on it and it will open a text input field in the button. Check the screenshot below:

In the text input field, you have to give the reference to the Object Array which you want to iterate over without any double braces. pre.gid_2.data in this case. Where gid_2 is the name of the gambit on which you made the API Call

Once done, you can then use the object keys within an object (in that array) to refer to the values for corresponding objects. So in the screenshot above I am trying to display the data coming from API as follows:

And the Buttons will look like this:

Similarly you will see the Data Iteration icon-button next to Messages bubbles and Cards. They have a similar interface.

Did this answer your question?