Toolbox plugin - collection of utility elements

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

wouldn’t that mean you have to separate the process into a different javascript?

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.

1 Like

that would be great. thanks. I even tried running 3 javascripts in the same workflow with the first to display and the second to hide. And realized immediately that wouldn’t work because the process still runs through all of the actions before updating the page.

New Version 1.3.0

  • Javascript to Bubble: add queue feature

image

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

Turn on Queue as above.

Demo editor

Normal use of bubble_fn_q(value), but the current value is the first one sent.

image

image

Use the Dequeue element action to move the next value in the queue to be the new current value.

image

After the last Dequeue, the current value becomes empty.

2 Likes

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. :chicken:

2 Likes

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.

1 Like

@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.

for example

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 #

Interesting…So I have to array lists coming from the same javascript action . The first Jbt is for password and the second for phonetic password. I then referenced the RG to the first Jtb. And then I set the first multiline element to Current Cell text. But I don’t know how you reference the second multiline element in the same row to the second JtB using the current cell’s index of the first Jtb - knowing that both multiline elements are sharing the same RG.

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.

Hi all,
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:

  1. Send a mathematical expression e.g., ((10+5)+(10*5)) to a backend workflow.
  2. Process this expression in a Server Script.
  3. 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!

1 Like

Version 2.0.0

BREAKING CHANGE Server script

  • Upgrade to plugin api V4
  • Async function
  • Ignore/log error
  • properties.keyvaluesobj
  • 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

3 Likes