However, when I try to consume this API by trying to log the return value to my Log data type, I am unable to resolve that the return value from the get-most-aged-site api is Site:
Finally, the API does return something, but it just returns an incrementing number, such as 174, 175, 176, etc. each time I run it. I’m expecting it to return a JSON representation of Site.
I am trying to create a simple API that queries the Site table and returns a single Site, but this does not seem possible with my approach.
Return data from API can only be used if you call your backend workflow from outside Bubble or using API Connector, not using schedule workflow. You can search forum about this subject/request but read this post:
Now that I understand that if I am going to take the current approach of putting specific “logic” into individual backend workflows, I am questioning my overall approach.
What I need to do is query a single Site, then once I find the aged Site, I need to query for a single Category belonging to that site, then using the output of that call, I need to query for a single Tag associated with that Category.
This all needs to happen on the backend workflow.
What is the best approach to handle something like this?
There is no UI component for this in the end. I only setup a button for testing. This will be a recurring backend workflow. It will take the results from the searched Site, Category, and Tag and store them into the database.
Actually, your backend WF just do a search and return the result of the search. This can be done in frontend. After, you said that from this response, you query a single category… Is it another DB? If yes, this can be done in front end… same for tag…
Finally, what do you need to store them in DB? The result of the search? or will the user do some actions and this is what you need to store? (select a site, afte select a category and finally select a tag?)
@Jici what I mean is this entire process will be done only with backend workflows. I am all wiring it up to a button click for convenience.
So, in the end, it will be a backend workflow that gets locked off initially by a recurring workflow or external API call into the site. Then it will process the records (query site, then category, then tag), and then store those values into a new record.