Toolbox plugin - collection of utility elements

Hi,

I am using “JS to Bubble” element, but unfortunately the value is not getting set into it.

This is how elements are set up:

This is my javascript code:
Screenshot 2020-05-27 at 12.31.28 AM

This is what I see in console:
Screenshot 2020-05-27 at 12.31.13 AM

What am I doing wrong?

Funnily, there is another “JS to bubble” element in the same page, which is working. I tried to check every character by character as to what is different, I am unable to see the issue.

Please help.

Thanks,
Mukesh

Were you ever able to figure out what is causing this error? I am getting the same error in an app I am working on even though I have successfully used the plugin to do this in a previous app.

Hello,

I retriving busy date from google calendar using API, I would like to be able to access to data using ‘List Item Expression’ but I tried many expression without result.

I’m using Google calendar API as data source :

I’m tring to access to start and end time, JSON has this structure :

Currently it’s just displaying some coma on my bubble page :

I would appreciate your help.

Kinds regards,

Might be a bug generating dates and date ranges. When I pull a date from a date picker and attempt to add seconds (just a raw number to test), the output is empty. The expression appears to be valid with blue confirming text. When I output the expressions (date or date range), the text box shows nothing. Maybe I’m doing something wrong. Other basic expressions that output numbers works fine for me.

Hi @mishav . the Bubble support team said I should contact you about a bug with the plugin. Here is the error its giving:
bubble eror js

Here is the workflow:

Its happening when I click on a repeating group field. It doesn’t happen on all of the fields just on certain ones. I had Bubble double check to see if it was a database error and they said its with the plugin.

That’s you and YOUR code, though it does look like all your obvious open parens are closed.

Are you sure quill.editor isn’t a function? That is, it might need quill.editor().isBlank(false)rather than what you’ve written.

(I don’t know anything about the quill library so can’t help you further. Just know that all Run JavaScript does is take your code as a string and tosses it as the argument to eval(). So basically, there’s no bugs in RUN JS as basically there kind of can’t be. Bubble support won’t assist you in debugging your own code, which is why they sent you here.)

Thanks for the reply @keith . I paid to have the code written for me so I’m just trying to work it all out. It’s just odd that it works on specific rows in the group and not on others. thats why I thought it was a Bubble issue at first.

I tried what you suggested but got the same result. I don’t know if this helps:

As you can see it does pull in the right value ‘Here’s your chance to _____’ only it won’t insert it in the Rich text editor. The field above that looks the exact same in the debugger only with a different value and it works perfectly.

Here is a quick 30 second video showing the problem in the debugger

I had the exact same issue and it persisted for a bit. Finally I solved it by using the rich text editor to remove all formatting from the JS code and it worked. Wish i had a better explanation but it might be worth a shot.

1 Like

Thanks! Sorry I don’t quite follow, How do I go about doing that?

If you navigate to the Run Javascript action, you will see the code and a link to open the rich text editor. Inside the editor there is an icon to remove formatting from the code. Unfortunately if you’re not familiar with this, the icon may be hard to spot. I am happy to help over a call. My time zone is EST and i will have some time tomorrow. Which time zone are you in?

This is a great plugin that is a savior when it comes to financial calculations!

Unfortunately, I’m running into a few errors all of the sudden, and can’t seem to decipher the error logs:

The plugin Toolbox / element List Item Expression threw the following error: SyntaxError: Unexpected token ‘*’ at toolboxEval ([https://dd7tel2830j4w.cloudfront.net/f1531838926669x106800532434135680/toolboxeval.js:1:181 ] (https://dd7tel2830j4w.cloudfront.net/f1531838926669x106800532434135680/toolboxeval.js:1:181) dominion energy solutions reviews) at eval (PLUGIN_Toolbox-update–List-Item-Expression-.js:1:238) (please report this to the plugin author)

Expression: (1+r/n)^NT

The plugin Toolbox / element List Item Expression threw the following error: SyntaxError: Unexpected token ‘,’ at toolboxEval (https://dd7tel2830j4w.cloudfront.net/f1531838926669x106800532434135680/toolboxeval.js:1:181 ) at eval (PLUGIN_Toolbox-update–List-Item-Expression-.js:1:238) (please report this to the plugin author)

Expression: (1+(r/n))

The plugin Toolbox / element Expression threw the following error: SyntaxError: Unexpected end of input at eval (PLUGIN_Toolbox-update–Expression-.js:1:73) at https://dhtiece9044ep.cloudfront.net/package/run_debug_js/1fbba0abc51dc67dc02d293980a57c6d749be00d1d8510da92941669622aa441/xfalse/x5:13:1955868f=66&t=167856&p=437394#p437394 (please report this to the plugin author)

Does anyone know how I can correct these?

Hey, did you fix that? I can help

I have not found a solution yet. These error messages still appear - but the calculation works so I have just been ignoring them. If you have a solution I would love to hear it, thanks!

Hi,

I am using the list of numbers feature, and love it.

However, I have a problem. When the page (popup) loads, the list of numbers generates. However, the basis for the list (a count of things) can change while the popup is still loaded. When this happens, it seems that the list doesn’t change as well.

Is there a way to use a workflow to get the list of numbers to “recompute”? I feel like I’ve seen this before, but I can’t find where…

Thank you!!!

Hello @mishav
I was trying use JS to covert JSON to html to show in a page. I am not getting.


This is my editor
image
This is my jselement
image
This is my JS
am I doing any mistake?

Hey Folks

I’m trying to run a server script using toolbox, to stream data from an external website. To do the streaming of the data the webiste provides a Nodejs script. I’ve tested it and it works 100% on my computer. But when I add the code to a workflow, I get an error when I check the develper tools.

The error is this
Screenshot from 2020-10-23 16-48-08

As you can see the nodejs that toolbox uses doesn’t have the module requests installed

My code looks like this
Screenshot from 2020-10-26 10-25-15

As you can see it’s pretty simple and I use the request module to make requests to the API. Is there a way of adding the requests module to toolbox? Or is there another nodejs module on Toolbox that I can use?

bubble_fn_obj in your code but in your element it is bubble_fn_output?

Hi All !

I hope you are well :slight_smile:

I’m new to bubble and I want to integrate a nice “Donut” chart, I know how to integrate hard values in my html element, but I want to integrate information that is stored in my Bubble database, here is the example:

how to replace the countries and litres to retrieve my data stored in the database, when I do a “Do a Search” my elements are all on the same line separated by commas.

If I can have an example, thank you very much for your help.

Should I be able to run this as a Server Script?

convertBQToMySQLResults(schema, rows) {

    var resultRows = []
    
    function recurse (schemaCur, rowsCur, colName) {

        if (Array.isArray(schemaCur) && !Array.isArray(result[colName])) {
            for(var i=0, l=schemaCur.length; i<l; i++) {
                if (colName === "")
                    recurse(schemaCur[i], rowsCur.f[i], colName + schemaCur[i].name)
                else
                    recurse(schemaCur[i], rowsCur.f[i], colName + "." + schemaCur[i].name)
            }    
        }

        if (schemaCur.type && schemaCur.type === "RECORD") {
            if (schemaCur.mode !== "REPEATED") {
                var valIndex = 0
                for (var p in schemaCur.fields) {
                    if (rowsCur.v === null) {
                        recurse(schemaCur.fields[p], rowsCur, colName + "." + schemaCur.fields[p].name)
                    } else {
                        recurse(schemaCur.fields[p], rowsCur.v.f[valIndex], colName + "." + schemaCur.fields[p].name)
                    }
                    
                    valIndex++
                }
            } 
            
            if (schemaCur.mode === "REPEATED") {   
                result[colName] = [] 
                for (var x in rowsCur.v) {
                    recurse(schemaCur.fields, rowsCur.v[x], colName)
                }
            }
        } else {
            if (schemaCur.mode === "REPEATED") {
                if (rowsCur.v !== null) {
                    result[colName] = rowsCur.v.map( (value, index) => { return value.v })
                } else {
                    result[colName] = [ null ]
                }
                
            } else if (Array.isArray(result[colName])) {
                let nextRow = {} 
                for (var j in schemaCur) {
                    nextRow[colName + "." + schemaCur[j].name] = Array.isArray(rowsCur.v.f[j].v) ? rowsCur.v.f[j].v.map( (value, index) => { return value.v }) : rowsCur.v.f[j].v 
                }
                result[colName].push(nextRow)
            } else {
                if (colName !== "")
                    result[colName] = rowsCur.v
            }
        }
    }

    for (var r=0, rowsCount=rows.length; r<rowsCount; r++) {
        var result = {};
        recurse(schema, rows[r], "")
        resultRows.push(result)
    }

    return resultRows
}
1 Like

Yes it should run, if called with for example …

  • schema being an object or array converted from JSON
  • rows being an array converted from JSON
  • resultRows converted from an array of objects to an array of JSON strings

Having a useful result depends on what the data is like and how you want to use it.

If you like you can PM me with some sample data, and I’ll look further.

2 Likes