Converting JSON result from Toolbox’s Javascript into list of things

Converting JSON result from Toolbox’s Javascript into list of things

Hey guys, i’ve been working on my simple compound interest rate calculator web app.
So i want to show the table of compounding rate every year as the user input it. Practically it’s supposed to look like this:

I have put “Run Javascript” after user clicking the input submission button like this:

The output is JSON. I tried to log into console using console.log and i can see it works. it looks something like this on my chrome console:

So it works.

Now the question is how do i store this list so i can make present a table and make a chart out of it?

I’ve been trying to find the answer for 4 days now. There are a lot of question and answer about converting list of things to JSON but i can’t the other way around.

Can someone enlighten me please?

Or show me what kind tutorial what might help me?

Thank you in advance and stay safe everyone!

The only “bubble native” way to do something like this would be to run your javascript function using a service like, AWS lambda or pipedream and get the results back of your function via a api call. You can then use the results as a list and populate your data.

The more difficult way which I don’t recommend at all is to make every key/value in your objects a array and using the the JS to Bubble tool make multiple states and then use that data to populate your RG…but once again I do not advise to take this path.

1 Like

Hi Shawn, i really appreciate your response! I will check these solutions out. :pray:

Hi, i checked the pipedream one. it looks promising. do you mind to elaborate how to connect bubble to pipedream? in my understanding it would be by using webhook right? but i’m not sure what is the next step?

In the most basic sense.

Bubble makes a api call to pipedream carrying all the data you need in your javascript function

Pipedream will execute your js function using nodejs

Once the functions returns your data, it will use that as a response to the Api call which was initially made.

Bubble captures that response and you can use the data however you want.

Are you familiar with javascript?

1 Like

I’m also trying to get this working to make Bubble play nice with Facebook webhooks but not familiar with JS and struggling a bit. Any advice?