Not usually, the long process will delay the event being handled, but not the setting of the value.
Unfortunately, the way the plugin builder is setup, there is no parameters to pass with the event.
You could build your own queue, but I think for your use its a bit over the top.
One solution might be to have the event trigger the next phase in processing
You could have a single code base with functions serving as entry points.
I just realised that this would be possible if I built a queue into js2bubble. It would need an additional workflow step to dequeue the values and trigger the event again.
I’ll have a go at it when the time is not stupid-o-clock.
New Version 1.3.0
When to use
When the script is sending multiple events and values to Bubble, and you want to preserve the current value (which is normally replaced) until it has been processed.
Example of how to use
Queue as above.
Normal use of
bubble_fn_q(value), but the current value is the first one sent.
Dequeue element action to move the next value in the queue to be the new current value.
After the last Dequeue, the current value becomes empty.
It’s awesome to see Toolbox getting updated again!
Just to clarify, if i have “queue” turned on and i don’t apply a dequeue action then the event will only return the value the first new value instead of the final value without “queue” turned on?
@ihsanzainal84 yes you got it.
Its helpful to have another explanation, I tend to stay in abstractions, so thanks!
It is a lot slower than without the queue so if you only need latest value, leave it off.
A couple of more updates in the pipeline. I’m all out of rubber chickens, so sorry no prize for guessing.
Amazing that you were able to turn this around so quick. Thanks. And good job. How soon will you be able to release this update to the plugin page.
@s.arndt you’re welcome.
I think I know what you mean … on your app’s Plugin page:
So in my example where I build a list and display the list in an RG, and I want to display a message before the RG is built and displayed, and hide it after the RG is fully populated and displayed, do I do the following in a single Button click event?
Action item 1 - Run JBT - function q - display message
Action Item 2 - Dequeue function q
Action Item 3 - Run JTB - function q - build - and display list
Action Item 4 - Dequeue function q
Action Item 5 - Run JTB - function q - hide message
Action Item 6 - Dequeue function q (Or Clear function q)
i have an array that contains a list of passwords that is used to populate a RG. I also have an array that has a corresponding list of phonetic passwords that correlate to the passwords in the password array. i tried setting two multiline input elements in each row in the RG with the idea that i could display both the password and its related phonetic password together, but it doesnt work. DUH…
What i was wonering is if i could have a single array with both the password and its phonetic passworld in the same item; and then send the item to the javatobubbles element. and then reference the password portion of the item in one multiline, and reference the phonetic password portion of the item in the second multiline.
item 1 password is AA1?$UA8.
item 1 phonetic is Alpha Alpha One Question Mark Dollar Sign Utility Alpha Eght
ML1 is loaded from JavaToBullet1 with the password for item1. Dispayed is AA1?$UA?8.
ML2 is loaded from JavaToBullet2 with the phonetic password from item1. Displayed is Alpha Alpha One Question Mark Dollar Sign Utility Alpha Eight.
Both ML1 and ML2 are displayed vertically in the s as me row in the RG.
That won’t work, the value will only be the same as set at the start of the workflow.
However you can make it work with
Schedule custom event, each time the custom event runs it will grab the current value.
Yes, you could use a delimited string and split it in Bubble.
I think it’d be easier to have two JS2B elements, both outputing a text list. Then the RG can use one as a data source, and lookup from the other one using current cell’s index to reference list item #
Ok - I think I stumbled into it. Basically in the second Multiline element, I set Initial Content to be JBT2 Value List: Item’s Current Cell Index. Thanks for the suggestion.
Could anyone kindly guide me on how to securely evaluate a mathematical expression using Server Script?
My current method has been to use an API call to math.js but I have been running into issues with reliability so I’d appreciate any suggestions or pointers to help me get started.
Here’s what I’m hoping to achieve:
- Send a mathematical expression e.g.,
((10+5)+(10*5)) to a backend workflow.
- Process this expression in a Server Script.
- Return the result to be used within the application.
What do you mean by “securely”?
The math expressions you can use in Server Script are what comes with Node.js.
Examples are in here : examples editor
To send parameters to a backend workflow, the usual method is Schedule API Workflow.
Following steps in the same workflow can refer to “Step 1’s result” etc.
Thank you for your guidance. I’m new to this and initially thought I needed to do something more complicated. Now I understand that I can just place the plain text expression into the Server Script and it will process it. This makes things much clearer. I appreciate your assistance!
BREAKING CHANGE Server script
- Upgrade to plugin api V4
- Async function
- Ignore/log error
- Multiple outputs
If your app uses Server Script, most likely the script will need to be modified.
Details on the new doc site for toolbox