How do I call an API on Button Click as opposed to every time a TextBox changes?

Hi, I have been trying to set up a simple form with a TextBox and a button for sending text in a POST call to my API/Plugin.

So far I can make calls and receive responses, the problem is it takes place every time the text undergoes any changes. I would like to send the text on a Button Click and display the API response in a Text Label.

Thanks in advance.

Hey! Just change your call from Data to Action under “Use As”

1 Like

I think he needs both :slight_smile:

I tried this and now I can add the API call as an action on the Button Click workflow. However, I am unsure of how to change the Text Label’s value to the result of the previous action. I can use it as a condition (“Only when”) but I haven’t found a way to pass that value into the Label as opposed to using it as a trigger/flag.

You will have to wrap your text label in a group and then once you run your api in the workflow you will have to add a step called “Display data” and then chose the wrapped group and set the result of the api call as the data.

You will also have to change the “type” of that wrapped group to match the data type of your api call response.

1 Like