I have two table: 1) “Orders” and 2) “Points”. The “Orders” table contains a number of fields, one of which is Order No. The “Points” table contains fields Order No. and Point ID.
I also have an external cloud database tables that houses a significant amount of information about each of the Point IDs (i.e. one table with numerous fields, including Point ID)
Here is what I would like to do:
Click button on bubble web app → 2) Send API request to cloud service with the order number → 3) Step 2 triggers Cloud Service to API request to search for all Point IDs in the “Points” table that have the Order No. I supplied in the previous step.
I know that the Data API is needed for Step 3, but I am struggling with how I would do Step 2. Would this involve a POST request to my cloud provider through the API Connector? And then there would need to be a script in the cloud that triggers when a new order number is posted?
False. You can always use Backend WF with Return data from API.
The search functions of DATA API can sometimes be too limited and you may need to use Backend WF API instead.
Also, POST in DATA API are to create item… not to search. This can only be done using a GET request to DATA API. Backend WF API doesn’t have specific functions.
I’m a little unclear as to why I would need the Return data from API. Isn’t that only when I want to return data from the external service? In this case I want the external service to query the data in my bubble tables.
And, when I was speaking about POST, it was not in the context of using the Data API, but strictly POSTing the order number to the cloud service, not asking the cloud service to create data in my app.
You would create an API Workflow in Bubble that, when triggered by a POST request with the Order No parameter, performs the following steps:
External Service Call: Within the Workflow, make the call to send the Order No to your external cloud service.
Search for Points: In the same Workflow, add a Search for Points action, filtering where Order No = the received parameter.
Return Data from API: Configure the Workflow’s Return data from API to include exactly the list of Points (or any other fields) returned by the Search for Points action.
On the frontend, you simply:
Set up an API Connector call pointing to the endpoint of the Workflow you created.
Trigger this call (for example, on a button click), and your app will receive the Return data from API in the format you defined.