Create and delete Things in Action code

Hi there,

I couldn’t figure out if there’s a way to create or delete Things in the Action code JavaScript? I’m imagining something like:

User.new().create(email: "hello@email.com");

My current guess that it’s not possible to do this in JavaScript - but maybe I’m missing something?

1 Like

I would like to know this as well. I don’t know why it’s so hard to figure out how to do.

While the plugin API docs are a bit opaque, the original post is completely batshit crazy and nothing in the plugin docs suggests that any of that should be possible. And, none of it is.

@josh.mamroud, none of the plugin APIs (client side element, client side action, server side action) can create nor can they modify Things (including a User, which is just a system-level Thing).

1 Like

@keith Good to know. You just saved me hours of additional research. Thank you!

1 Like

While none of the plug-in apis offer crud, you can still do it from the data api in an ssa.

2 Likes

@doug.burden Are there resources other than the bubble docs where I can find more info on this?

1 Like

You’ll need to allow access to the data api’s on your app and simply use the api connector to trigger the desired action

1 Like

https://manual.bubble.io/core-resources/api/the-bubble-api/the-data-api/data-api-requests

2 Likes

What @doug.burden says is true, but such approaches are application-specific, and if you’re trying to build a generically-useful plugin for the marketplace (vs a plugin specific to your own app) this can be quite challenging (e.g., you’ll have to provide a means for the Bubble programmer user to tell you about their endpoint(s) in question).

What I mostly wanted to stress is that (1) the plugin APIs do not allow us to create or modify Things programmatically (this can only be done by the Bubble programmer user via the create and make changes to Things actions) and (2) if you see some hint or implication that this is possible (e.g., in an old forum post, incorrect information from Bubble support, or a hallucinated idea from ChatGPT), please refer to point (1).

3 Likes

Super helpful. Thank you! This plugin was for personal use so I would have full control of the implementation but good to know regardless.