Populate an Auto-Suggestion Gambit via API

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 Likes

Hi @dan,

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

3 Likes

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

1 Like

Hey @dan,

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

2 Likes

Thank you very much @vinit !

1 Like

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.

2 Likes

MIllion Kudos, @vinit!

1 Like