The solution to my problem might be rather complex, so if anyone has a link to a video, it would be great, and probably easier to communicate the answer.
What I’m trying to do is have an input element into which some text is typed. When “Enter” is pressed, it should trigger a POST to an external API with the input’s value as the data that is sent, get data in the form of a response, and display some of this response data in a repeating group below. (Just think of how a regular search box works).
Now, while executing this functionality, I’m afraid I’ve gotten lost. I have an input element, but it is not explicitly triggering the POST call. In fact, there is no relevant workflow anywhere as far as I can see. I have set up the repeating group with the connections to the API data. In spite of the fact that there is no workflow, I’m still getting data from the API when I type into the input element. It’s rather puzzling.
The thing that is happening is: As I type into the input element, the repeating group gets automatically populated, almost in real-time. I don’t know how this is happening.
If someone could point me to a resource or tell me how to execute the functionality mentioned in BOLD above, I’m really appreciate it!
You may be better off setting the API call as “action” vs “data” and then creating a workflow that is triggered to call the API with data from the input box and send the results to the repeating group.
You should also think about using conditionals if you are having trouble with your input box triggering a search too early, could limit it activating the search based on number of characters or some other criteria.
This is how I do it, it will vary depending on the API you are using.
In the API Connector I make my call. The key part is the JSON object where you will see:
Then in ‘Body parameters’ you see I have:
Key: modifiers Value:\b(are | can | …)
(this is the dynamic value I am passing to the API that performs my search. You can leave the value expression blank if you want, it only has a value in the API Connector so that I can Initialize it and test it works.
So basically this is how I am passing the values a user puts into my input/search box.
Then in the front end where I am specifying the source of the data for the Repeating Group, I pass the value of the Input Box into that ‘(body) modifiers’ field. So:
\\b(Current User's Question_Modifiers...)\\b
Is the value of the input box where a user types their search value. Whenever they type a new value the API call automatically gets called again and the RG instantly updates to show the results. I’m loading up to 2,000 rows of data this way and it’s almost instant.
So in my case, everything is done in the frontend, no workflows required.
Thanks, this seemed to work.