Javascript access bubble db

I consider first the issue (you need to show specific thing according to a filter on user). I suggest a way, yes this was not the one that you first talk, but I consider it to be valuable (and less complicated and why bubble exist: no coding).

Now you want to do it javascript. Do it.
Now maybe you can take a look at Toolbox plugin - collection of utility elements