Update Created By Field

I need to update the “Created By” field in the database. It seems to me, that this is somehow locked. How can I unlock it?

1 Like

You can’t modify the ‘Created by’ field - it’s a system field, set automatically to the user who created the thing.

If you need to manually set and/or modify which user created a thing then you’ll need to create a custom field for that.

3 Likes

Thank you for your quick response.

That seems to be a fundamental flaw in the system design of bubble. If I don’t have full control over my own application, but bubble get’s to decide, then I basically don’t really own my own application.

I wonder then, if I even should use the built in authentication/authorization functionality or if I should build my own, so I actually do have full control over it, if that’s even possible?

Or should I just duplicate all the built in fields into custom fields such as password, created by, created date etc. and update them simultaneously when updating the original ones. But then still, the core functionality of bubble relies on their built in fields, which they control, not me.

And if I use your suggestion of creating a custom field for the user for example, then quickly that custom field will not contain the same information as the built in anymore. How do I handle this breach in data integrity?

So basically what you are saying is, that I will never attain full control over my own application?

There are only 3 built-in fields that you can’t edit, and they don’t have any relation to the ‘core functionality’ of Bubble (well, apart from Unique ID in some cases, but you can use Slug instead for most things which gives you full control) - if you don’t want to use them don’t use them, use your own fields instead - I’d definitely generally suggest having an additional User field for certain database items, aside from the built in creator field anyway.

And if I use your suggestion of creating a custom field for the user for example, then quickly that custom field will not contain the same information as the built in anymore. How do I handle this breach in data integrity?

I’m not sure why this should be a problem to you? The Created by field is set automatically to be the User who created the database item - that’s a pretty useful thing to store, as is the created date.

In most cases those fields will correspond to the the User who created them, but if, for example, you’re adding historical data via CSV or API then, obviously the created by field will be set to the ‘Admin’ user who ran whatever workflows were required to add the data.

Again, it’s useful to have that information anyway, but if (as you likely will) you need/want to associate those things to a User, and/or record the original date the data was created, it’s simple and logical to have custom user and date fields on the datatype for exactly that purpose.

So basically what you are saying is, that I will never attain full control over my own application?

I didn’t say anything of the sort.

2 Likes

Correct. Some of this is abstracted away to make building something faster. Becase…really…the created_by is always going to be the user (or not) who was logged in when it was created. And it would be created at a date/time that was acutally the date/time of the server (which you won’t have control over unless you own the server).

If you want full control, then you will have to build your own database on your own server running your own OS.

Ultimately it is a tradeoff. But I am willing to wager that whatever it is you are trying to do doesn’t really need you to update the “created by”.

Although you can actually just delete the thing, then have it recreated by another user. That will update the created by for you.

But I have no idea why you would do that. And I have done a LOT of weird stuff in Bubble :slight_smile:

2 Likes

Hello, wondering if you may have an idea for my case. We have an api that creates a database item and we have always used the api key so everything’s Created By says “app_admin”. We realized that it would actually make our app run better if we only displayed the items to user’s who are the created by user. I was thinking we could run a backend workflow to assign a user based on other fields but there is no way. And we would prefer to just use created by instead of adding another user field. Do you think there is a way to use a backend workflow to create a duplicate of the original but somehow let the new duplicate know the correct user to use as created by and then delete the original. I am wondering if passing in a user id in a api request to create something in bubble will then make the correct Created By. There is no mention of the Created By field, that I can find, in the Data API docs.

2 Likes