Hi Bubbles, im working on crypto price watchlists, can someone tell me in details how do i display a price from each coin that i fetch from API and display it on my bubble data coins data ( repeating group ).
my bubble data looks like this:
(data type)Coin - (field)Price (type)number
im a newbie and i need solution for this, hope anyone can help
In order to systematically create a list of things you need to schedule a backend workflow on a list, the list being the results of your api. Then make step one be create a new Coin, Here you can assign the appropriate fields. You should have a field in your database that is the unique identifier for each coin from your api. This way this create a new Coin can conditionally only run if do a search for a Coin with that unique identifier does not exist. The second step would be to make changes to a Coin, conditionally this would only run if a search for a Coin with that unique identifier does exist, and you will be changing the Coin that exists by updating the price or value (whichever fields tend to change).
Finally, the repeating group will just do a search for all Coins.
The trigger for activating the workflow depends on how “up to date” you want the prices to be. You could do it on page load, a refresh button, a recurring backend workflow. Any of those would work. To be extremely accurate all the time it seems like it would have to be a Webhook pushed to you by whichever company your are getting your info from. But for this example just pick any one of the first three options.
Every coin/stock has a unique identifier, whether it be the name, ticker, symbol, whatever they call it. This needs to be saved to each coin created in your database so that when the workflow runs a second time it does not create duplicates but instead updates the price for the existing coin in your database.
You have privacy rules on your app to where I can not view it. You can go to Settings > General and then the top option for “Editor access permissions” needs to be changed from “Private App” to “Everyone can view” just for the time you want others to view the editor.
Yea, I looked and I am not sure which API call you are using to get your data. I saw two different calls that get crypto info. You just need to create a backend workflow that runs on a list and then configure the action steps like described in my first response. Also, I looked at your data types and there seems to be a lot more fields than is returned from the api.
Don’t forget that if you set yourAPI Call to DATA, You can simply just store the whole Payload in a field that is of the type of API Connector. Each time you have an API of “Data” type, Bubble create a “Thing” of that type that can be used to set a field of that type exactly like when you create another DB.
ahh i see, but i only want to pull the price from the API and im using it as ACTION, you have any suggestion on my workflow? to make it better or simpler?
You should probably make it to where you only have one api for getting price and make the {address} or id of each coin dynamic. Then you can save that ID to each coin in the database. Then you can schedule an api workflow to run on a list, the list would then be a search for all coins in your database. Then for each coin it can make the api call for price, plug in the dynamic address/id and then update the price before continuing to the next item. This will turn your 25 step page is loaded workflow into 1 step.
Change the type to DATA. If the goal is to get data, and not make an action on the API, it should always be a DATA type, not action. In most case, consider a GET request to be DATA. POST if they are using to search on the API should also be set to DATA. All other call like POST (to create) PUT, PATCH and DELETE should be action (because this is what they are!).
But the main issue actually I can see in your settings, is the use of different API Call while you should use dynamic url parameters.
can you show me the step to stored each api data called into my each coin field? im afraid if i save it as a data and i cannot put it into my bubble data field because im using repeating group
You will first need to fix the multiple to single call.
Basically, in url, you just need to replace dynamic part using [] like erc20/[address]/price
and uncheck Private box for this parameters