Toolbox plugin - collection of utility elements

@mishav

In an API workflow, I want to take some data from one of the fields in the database in a workflow step (1), run a series of math calculations on it in the next workflow step (2), and use the result in a subsequent step (3).

Is this possible using the plugin ?

Unfortunately, no not yet.

Everything in an API workflow runs on the server, so client-side code is not available. For custom plugins, Bubble has not yet turned on the server-side code.

If you can’t find a workaround using Bubble’s functions, your options are:

  • Make an API call to an external server.
  • Request a server function from Bubble team.
1 Like

@emmanuel
Any plans to enable this ability ?
Looks like these awesome plugins being developed for the community are currently not unusable with api workflows

3 Likes

I was hoping to use List Item Expression to help me get a list of dates.

I used List Of Numbers to get a list of offsets (0,1,2,3,etc) and I was going to add current date/time to each one to get a list of dates, but that doesn’t seem to be working cuz I can’t type “value()” into the “+days” expression.

Is this possible?
image

Yes, set a result type of date, and try this expression, the bold is a Bubble dynamic expression to pass in the initial date …

var d = new Date(Current date/time:extract UNIX);d.setDate(d.getDate() + value());d

The date addition is happening in the javascript expression, rather than in the Bubble expression.

3 Likes

@mishav This is a great plugin! I’ve been able to replace the Bubble date/time picker with the native one for a much better UX.

My question to you is whether this would allow me to use a javascript onClick event to store an input as a state in Bubble. For example, I have a feature where users can set the time slots that they are available for appointments. I use three steps to store data from the js input onto a thing:

step3

Currently, I can store the js input as a state only after running a workflow (the save button). Since I run other workflows based on the value of that input - rather than store it directly - I have to use the confirmation screen to trigger those other workflows.

What I’d like to do is store the js input as a state immediately on clicking the date, rather than running a workflow to store it. Would that be possible with some kind of js onClick event?

This plugin is just what I need, many thanks!

I have some troubles with List Item Expression though, together with Get data from an external API (SQL DB Connector). The data is a list with three fields.The Source item type and Data source are properly defined. However, when I try to reference the field with field("Name"), I get “Unable to get property ‘%f3’ of undefined or null reference” error in debugger. I see that the data is there, the name of the field is OK, but still the List Item Expression doesn’t give any output.

If I test a similar data structure with internal Bubble’s data type, it works OK.

Yes, you are on the right track with thinking about an event. If you include an element Javascript To Bubble, and configure it to expose a value as well as trigger a workflow event, you can have another workflow based on this event to put the value in a custom state.

This workflow event can be triggered from within your javascript event handler by calling the function bubble_fn_yourname(value), see examples on the demo app or as described further up in this thread.

1 Like

Sorry to say that List Item Expression isn’t able to handle data structures added by API or SQL plugins. Yes it would be nice, but I wasn’t able to discover their in-memory storage structure in the time I had available.

Thanks, good to know.

This is a great plugin!
However I was wondering if I could use it to build a nested JSON. I want to show the JSON to the user in the frontend (and ultimately use a “copy to clipboard” button for an easy copy/paste flow for my user).
I’m playing around with the ListItemExpression but cannot figure out how to use it or if it’s possible at all.
I have different database tables:
Goal
– Goal_Name
– List_of_Subgoals
Subgoal
– Subgoal_Name
– Belongs_To_Specific_Goal
– List_of_SubSubGoals
SubSubgoal
– SubSubgoal_Name
– Belongs_To_Specific_SubGoal

So in the Bubble universe I can adress each of them because they are all connected (list_of or belongs_to). How can I adress these things with the ListItemExpression and how can i tell the plugin to e.g. show all subgoals of a goal (like in a JSON).

Is it possible to achieve this with your plugin?
Thanks!

Yes there’s a rough example in the demo app …
Link in this post: Toolbox plugin - collection of utility elements - #19 by mishav

1 Like

Thanks for the quick reply, @mishav!
I already tried it but failed. But good to know that it will work eventually. Will tinker around with it a bit more and try to figure out how to adress different database tables.
Thanks again!

I’m really sorry to bother you again @mishav but maybe you can help me out on this one.

I tried everything and read a lot but can’t figure out how to access a list_of_items.
I made an example for easier access in the forumapp:
Editor
Viewer

It follows the logic i described in my earlier post (Goal, GoalSub, GoalSubSub) where 1 Goal can have 1-n GoalSubs and 1 GoalSubs can have 1-n GoalSubSubs.
I can manage to access another database table when there is a 1:1 relationship (e.g. display GoalSub and the Goal to whom it belongs).
But I cannot access a list_of_items when there is 1:n relationship (e.g. 1 Goal has n SubGoals).

Can you point me in the right direction?

Thanks again!

Edit: problem solved.

Knowing that I didn’t want the element visible on the page, I unchecked ‘This element is visible in page load’. Apparently this also disables functionality of the element. After I checked the box, the list was populated. The element is invisible anyway.

@mishav,

The List of Numbers looks straightforward enough, but I’m not getting what I expect.

In short, requesting a list that starts with 1, incremented by 1 and 12 in length, I am getting an empty list.

Here’s how I specified the list:

image

The result is empty.

What am I missing? Is there some documentation I should have found that explains what I should be doing?

@mishav if i havent thanked you for this already. Thank you!

Know if there have been any updates to enable “run javascript” as an action in the API workflows?

To my knowledge, the bubble team hasn’t implemented this yet

Is a bubble ask or a mishav (toolbox engineer) ask?

Bubble ask