Forum Academy Marketplace Showcase Pricing Features

Bubble_fn not setting JS to Bubble element value in Toolbox plugin

Hi,

I am using “JS to Bubble” element of Toolbox plugin, but unfortunately the value is not getting set into it.

This is how elements are set up:

This is my javascript code:
Screenshot 2020-05-27 at 12.31.28 AM

This is what I see in console:
Screenshot 2020-05-27 at 12.31.13 AM

What am I doing wrong?

Funnily, there is another “JS to bubble” element in the same page, which is working. I tried to check every character by character as to what is different, I am unable to see the issue.

Please help.

Thanks,
Mukesh

I am able to reproduce this issue in a separate independent page. I think its a bug.

You can test the issue on this link: https://beegle.app/js_test2

Basically, when you press the button, it assigns a value to one of the “JS to Bubble” element. Then I try to retrieve value in the workflow and it shows that as empty when I put in a condition “Is empty”. But when I use it as a dynamic expression “Element’s value”, then the value gets assigned to the elements correctly.

Also, I am not able to read the value in Javascript too. When I print the value in JS console, I get empty value like this:

What is going on?

Here are the set up details:

Screenshot 2020-05-27 at 11.06.57 AM

Screenshot 2020-05-27 at 11.06.49 AM

@mishav this may need your attention as it clearly looks like a bug to me.

Thanks,
Mukesh

Your issue is that you are putting putting the output value in quotation marks so:

console.log('Test content: '+'JS2BTest's value');
should be
console.log('Test content: '+JS2BTest's value);

No Edward, that’s not the case. This is how “Run Javascript” works. I had tried putting it without quotes earlier and had got syntax errors.

I am very confident of this as I am using JS to Bubble at another place where it works, and I am using the console log bit exactly same way.

Also, the issue is not just in printing of the value. As you can see in my second example, Bubble is finding the value of JS To Bubble element to be empty. I have even given an example URL where you can try what I have built.

I am surprised no one else is facing this issue. I am facing it again and again.

Is there some caching that JS to Bubble element needs to clear or some such thing?

I have experienced this issue.

I have setup the correct workflow to pull in the value (let’s face it, it’s not hard. Set a variable and then assign it to your bubble variable).

It’s console logging perfectly when I output bubble_fn_bla but then when I have a workflow to create a thing, it’s empty.

I checked it’s a string (not object). It displays fronted fine in a text box.

As it’s a workflow, I did the usual check on possible bumps (privacy, data type). No bueno.

I contacted bubble support a few months back with a similar issue but as there is a plugin involved, it’s not their remit. (The great toolbox).

I find it’s usually easier to look for a workaround than to try and solve the black box issue.

Thanks for sharing this, Dan. Yes, it is an issue.

As you mentioned, I also managed to do what I wanted to do with some workaround which was not quite complete, but okay for my use-case.

@mghatiya was this issue ever resolved. I’m facing this as well. What work around did you come up with?

I was able to solve this with help from mishav

JStoBubble element: turn on “Trigger event”

Workflows:

Button click event → Javascript calls bubble_fn_myvalue(value)

JStoBubble A’s event → JStoBubble A’s value should now be available

1 Like

Thanks Daniel for sharing the answer. Great to hear.

Actually I had thought that I had found a workaround, but later realised that it didn’t work. Then I just gave up on using JStoBubble altogether and also on my use-case.

Will try your solution when I get to it next.