Hi All,
First of all, I would like to say Thank you to @mishav for creating Toolbox plugin. This is very helpful for working with Javascript in Bubble.
Currently, I’m struggling of list and Bubble table for query and return what I want.
I have Bubble table define as following:
| company | plan | coverage | annual payment |
In Javascript, I will have a number ex. 2,100,000. For this number I will spit based on coverage in Bubble table and return with possible of plan to offer.
2,100,000 = 100,000+100,000+200,000+200,000+500,000+1,000,000
This mean to offer 2,100,000 coverage, I have to offer 4 plans (100,000 x 2 plans, 200,000 x 2 plans, 500,000 x 1 plan and 1,000,000 x 1 plan)
Javascript to Bubble functions, I return with 2 lists,
item 1. list of number coverage (ex. 100,000 , 100,000 , 200,000 , 200,000 , 500,000 , 1,000,000 )
item 2. list of number of duplicate in item 1. ( ex. 2 , 2 , 1, 1 )
Previously, I tried to return 2 dimensional array ex. [ [100000,2] , [200000,2] , [500000,1] , [1000000,1] ]. However, this is not seem to work.
So, what I’m trying to do now is if I create a new Bubble table (with 2 columns 1. coverage 2 offer ) and put it inside Javascript instead. How can I do it in Javascript ?
Any help to solve this, very appreciated.