I’m using the Toolbox plugin and the JavascriptToBubble feature. For some reason I can’t store the value it publishes to the database. I can see the value in a text element or in a custom state so I know the value is there and working, it just won’t save the value to the DB.
@jobin.blancaflor@neilpierce I thought this question would be a good opportunity for a YouTube vid. Seems like you figured everything out but posting the video here too for anyone coming by this thread in the future! https://youtu.be/9jVEzPLRebI
Hi man! Would you like to share with us how did you figure it out with the trigger? since i’m having this struggle now to save the value that i can console.log in the console but can’t store it in my DB or at least show it in a element using the bubble_fn_name.
So when you’re using Javascript to Bubble with the toolbox plugin you need to set the data on on an input element first and then save the data from the input to the database. It’s a workaround / hack to get it to work properly but it works.
There is a problem with this, it will not store in the database because the javascript to element result isn’t a string, it’s a function. Another hack that I did , that I think will be far more elegant and scalable is to make a plugin, add an action that does what you want and then use the action as a workflow in your application and then you can simply retrieve the result in the next step of the workflow.
Make a plugin
Go to actions, and select “server side” so it’ll return a value.
Add a return key for the value for it to be assigned to, make sure to fill out all required fields. (if you’re using a dynamic value make sure to select it).
Place the function within the code with in the code section toward the bottom . Then take the result and place it in a return object at the bottom of the init function.
example:
set a return key to being text.
Place code like the following with the result in the return object assigned to the key you’ve just defined.
Example code:
////Assuming you have set a return key and named it “result”
Then click “go to test app” or test app if you haven’t assigned your app as a test app for the plugin. Then in the workflows, place the action where you want it and you should be able to use the result in the next(s) as simple text or whatever data type is needed!