Plugin actions -- how do you pass output to Bubble?

This is silly, but I have gone through like 15 plugin tutorials and haven’t figured this out.

I want my plugin action to generate an output, just a simple “Hello World” string! I want to be able to then use that output in Bubble the way I’d use other data, e.g. to “Make changes to a thing” or whatever. I thought that if I returned a value in the action that the workflow would make available one of those “Result of Step 1…” options which I could then use in Bubble. But that’s not working.

Some things I’ve tried:

function(properties, context) {
   return "Hello World"
}

function(properties, context) {
   return {result: "Hello World"};
}

function(properties, context) {
   return {"result": "Hello World"};
}

1 Like

Hi @brenton.strine
You need to call Javascripttobubble Event in workflow
Here is the link to all functions of toolbox plugin…

Also watch this video once, it shows how to display “Result of step1” from javascript

1 Like

That’s a nifty tool, thanks for sharing it! I’ll definitely use it in the future.

For this question though, I’m talking about building my own custom plugin, not using the Toolbox plugin.

You can only do that in a server side action. Not client. Element action item can return value in a state.

1 Like

That seems odd… if I want to write a plugin that takes an input and adds 1 to it, I need to hit the server first?

I think I’m missing something big here. I just want to have access to the output of a function in Bubble.

There’s two optins only. A) use element and state or B) use server side action. Bubble doesn’t actually allow to return value in a client action

3 Likes

Would it be possible to pass to an element state and then use it? How can I pass from an action to an element’s state? I haven’t seen anything about that in the tutorials I’ve gone through either.

You need to create an element. In element, you will be able to add states and also add actions.

1 Like

Upvote this:
ideaboard

Client-side actions can’t return anything, much less arbitrary objects. While object support would be great, we need the client-side API to be able to return values to the workflow first. This would radically improve Bubble in short order.