Populate an Auto-Suggestion Gambit via API


#1

Hi there

posted on Intercom also but i think this might be useful for other also.
Can i return via an API call a list of options and put them into an Auto-Suggest Gambit?


#2

Hi @dan,

Thanks for the request, This is a planned feature and will be released soon in the builder.


#3

@vinit - can you give an estimated ETA for this feature? Thanx


#4

Hey @dan,

I will try to get this done by end of next week.


#5

Thank you very much @vinit !


#6

Hey @dan,

You can now do this in auto-suggestion. Just pushed an update for this. Please clear your browser cache to see the update.

To populate a list of options in auto-suggestion input UI from an array of data coming from API you need to put it in a new line like a normal entry in the list. You start with the reference to the array holding all the values. So if the array is at data.memes path in the JSON returned on the gambit names meme_list, the reference to this array will become:
pre.meme_list.data.memes

This uses the same syntax convention as mentioned here: http://help.hellotars.com/make/advanced/data-iteration-from-api-call

After that you put triple colon (:::)
and then you put the relative path of the object property relative to the array reference.

So for this data:

com-2018-02-02-14-22-15-913

The configuration for populating all the elements in between first and last item will look like this:

First list item and last list item is not needed, but possible to add them like that.
Also {{id}} here is the option val thing, in the uval data scope. which you put after triple hyphen (). Again this is optional. Not needed if you don’t want to use option val for list items.

Check it out. I will try and make a video around this, to better explain it.


#7

MIllion Kudos, @vinit!