Forum Documentation Showcase Pricing Learn more

Toolbox plugin - collection of utility elements


#163

Hey @zelus_pudding,

My guess is the element you are referencing is not in the dom when the expression evaluates. Try setting the expression element to not be visible on page load, and then have a workflow event of When page is loaded > show expression.



Looking to accelerate your app development?

Let me turn
:thinking: :tired_face: :confounded:

into
:grinning: :sunglasses: :woman_student:

Development through Coaching at https://uniqueideas.com or schedule a free intro session :gift:

Ken Truesdale
LinkedIn


#164

That seems to have been the case :slight_smile: Thank you! Although, I would’ve thought that this function would re-evaluate every time the dropdown changes values but it doesn’t :confused: Any idea how to get it update with changed values?


#165

I figured it out… without actually referencing the drop down the expression wouldn’t reevaluate every time the dropdown changed. So I made a dummy function that took the dropdown as a dynamic input and then generated the index by direct attribute selection.

function get_index_of_dropdown(dropdown_value) {
    return document.getElementById("kitchen_oioio").selectedIndex;
}

get_index_of_dropdown("Dropdown Test Time 's value");

See:
image

Feelin’ good!


How to get index of selected value from dropdown?
#166

Any constraints in an iframe to use javascript to bubble ?

It works with basic example but when implemented inside a more complex iframe, I got error
bubble_fn_1 is not defined

My goal is to implement VGG annotator, a great tool to annotate images. I customized their code to

  • upload automatically images from a list provided by Bubble ( ok, works)
  • get the result (some text data giving x and y coordinates) into a Bubble’s input : does not work :thinking:

See below :


and

any thoughts ? thanks !


#167

Hi @mishav

Is Crypto / AES256 available in toolbox’s server script? Or is this a bubble limitation. I’ve run the following static encryption script, but receiving errors. Just trying to trouble shoot:

@boostsalesgroup Also tried something a similar script with HMAC with require(‘crypto’)

Thank you -


#168

Hey @mishav, et al,

Interesting behavior here, where I set a db value using javascript to bubble element, it fails on the first attempt, and works on all future attempts. I’ve stripped it down to the following basic test:

Gives me:
1rst Click:

2nd Click:

Notice that the amount_number is only showing on the 2nd hit.

If I simply set a value instead of using the javascript to bubble element, it all works fine.

Am I just being a knuckle head and doing something wrong?

Appreciate any help here!


#169

@gilles, I don’t believe you can require NPM modules in Server Script. There’s no bundler/install type feature there. But you can just do this as a server side action plugin.

Setup is roughly the same, but there’s a magic field where you can specify your dependencies.


#170

Thanks Keith - will check the threads relating.


#171

It’s real easy. Though note: SSAs are slow AF at the moment. (The same behavior is exhibited by server script so this shouldn’t surprise, but FYI.)


#172

Crypto is available, but you need to load it using

var crypto = require('crypto');


#173

I’m trying to use server scripts exclusively as state for API workflows, like a variable. Even my most basic example causes an error.

Here is the workflow, after which I do a “Return Data from API” although even without that return workflow it will throw the error.

In Postman, this is returned:

“message”: “Unexpected server error, please try again later”

When I go into the server logs, there are two sequential errors:

Workflow error - ret_val.custom_type is not a function

ret_val.custom_type is not a function

Am I doing something wrong?


#174

I’m guessing data should be “text”, since you want to return a string.


#175

@miguel The return type is text, isn’t the data field for the text itself?


#176

What I mean is that the text test might need to be double-quoted (or single-quoted), since what you want to return is a string.

But I have not tried it.


#177

I see. I gave that a try just now, it did not work either.