Dear Bubble community,
I am new to the Bubble platform and I am currently working on a project that involves setting up an API. While I have managed to set it up successfully, I’m having trouble understanding the proper usage of APIs within Bubble.
Specifically, I am confused about the difference between Action and Data, and how to properly set up workflows versus content data type within the design tab. I would be grateful if someone could assist me in clarifying these concepts.
Also, if anyone could point me towards any helpful guidance documents or videos that would help me better understand how to use APIs within Bubble, it would be greatly appreciated.
Thank you so much for your time and assistance!
Hi Zaj,
Welcome to the community, always good to see new faces. In short, the difference between Action and Data is:
- Data, when an API is set to data, you can use it as a datasource for an element on one of the pages in your app, f.i. in a repeating group, see the image below.
- Action, when set as Action you can use it as an Action in the workflow, f.i. as input for the next action.
In this case, for every item in the response of the API Test - subset a backend workflow is triggered, f.i. to create a row in one of the tables of the app,
Best,
Gerbert
MOG Consultancy / MVP Design
Thank you for your response and great to be part of this community!
What if I want to use the api in workflow and source of data for elements? Should I create 2 apis for the same thing with just switching data/action?
Hi Z,
Not necessary to create the API twice (although you can simply use ‘rightclick - copy’ to copy the API). In your case, just leave the API as Action and in the workflow use the actions ‘Display list’ or ‘Display data’ to display the response of the API in a repeating group or a group, see the images below.
Awesome! thanks a lot, boss. This is very helpful!
1 Like