Guidence needed in using an API

I am wanting to enter an SKU in an input box and get the corrosponding stock value via the API

I have set the API up in the plugin section, I am not sure if I have set it up correctly but it does return data.

Th problem I have is I dont know how to pass the variable to the API, in the above example “F750.FBM.AlFresco-CitySlicker” is the variable, I find it strange that I need to enter it in the VALUE field in the parameters in order to initialise the call.

Uncheck private. You’ll then be able to insert dynamic data in your editor.

OK I have done that but I don’t know (I’m pretty new to bubble) how to pass the SKU variable to the API call. I want a text box where i type in the SKU hit a button and the quantity displays, thats the bit i am struggling with

If you want it triggered by a button, you’ll need to change the API call ‘Use as’ to ‘Action’.

This will make the API call available to you in the workflow section.

To set this up, after you’ve done that:

  1. Place a button on your page
  2. Place an input field
  3. Place a text box field
  4. Set a state on your text field
  5. Make the text field initial input the text states value
  6. On button click, start workflow action, fill in dynamic sku with input’s value
  7. Set state of text field with ‘result of step 1 value’
1 Like

Thanks I will look at that in the morning. Can I ask where would I look for that information. Is there anywhere where itbia explained I.e a tutorial

Adding API Connections - Bubble Manual

Thanks for that, it was a great help, points 1-6 ran smoothly, I am though a bit stuck on Point 7. I am not sure how to Set state of text field with ‘result of step 1 value’ .

Can you post a screenshot of your workflow?

I seem to have got it working not sure if I went a long way round, or why I needed to use a “state” I thought states were used to store information to save reloading it all the time (I am fairly new to bubble)

Glad to hear you got it working.

States are just temporary values. It’s a great way to reference items that are on the page. In this case, you’re just setting the value returned from your API to a text element to display to the user from which they searched on.

Here’s Bubble’s documentation on States: