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.
That seems to have been the case Thank you! Although, I would’ve thought that this function would re-evaluate every time the dropdown changes values but it doesn’t Any idea how to get it update with changed values?
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");
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:
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:
@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.
I’m trying to send a stringified json result from an external Bubble APP Data API call to a RG. For this I’m using the JS to Bubble and Expression elements.
However when I do so it seems that the JS2Bubble element is adding commas and creating an array with all the chars in the stringified JSON.
I’m manually coding user data and trying to automate some of the most error prone parts. So I’ve got strings like “2019-03-11T0745” describing date and maybe time of data points.
Is it possible to use the expression widget to parse these strings into bubble datetime things?
I tried using “new Date(input A’s value)” like in this thread but even when I add ticks like “new Date(‘input A’s value’)” it doesn’t actually generate a date. Convert text to date
The closest I’ve gotten still gives me this error “The plugin Toolbox / element Expression threw the following error: Error: Expected a date, but got a object (original data: null)”
Google & Stackoverflow seem to think that javascript’s date() function doesn’t do a good job of parsing ISO strings. Is that what I’m running into?
I have a small issue/(misunderstanding ?) using bubble to java script in my app (value type : yes/no)
I fill it with a list of booleans by parsing a json string where the value is : ,“experiment”:false,
I then flip the values using a ionic toggle set to trigger :
I inspect my custom-state holding the modified values and it seems to be an ordinary boolean value
Trying to iterate my list to create an object to stringify, I get an error: no is not defined, or “nei” as it is in my native tongue.
I’ve tried using strings, numbers etc as the boolean value but there is always some fuss when either saving/parsing og stringifying.
When i inspect the element it says : nei = no
why not false,false,false etc…
Is there anything special as to how toolbox or bubble is handling lists of booleans, shold i just use strings ?
Is this just a common json parse/stringify problem
Are you setting bubble_fn_experiment in the JSON Updater custom event?
The screenshot you posted shows that you are passing what you apparently want to that custom event. What does the custom event do with that workflow thing?