Created by field is empty

I’ve got some data types where I’m copying the default “created by” field into a new “chosen user” field so that later I can differentiate between the user that creates a record and the user that record actually belongs to. Like so an agent can manage data for a client.

So I found that a few of the records that already exist don’t have anything in the “created by” field.

Why would that be? Maybe the user that created them was deleted?

Is there a way to insert a user into an empty “created by” field? I can’t edit that field in the database and I can’t select it in the expression builder.

2 Likes

Hey @blueback09,

I can’t give a definitive complete list, but I know of two ways the Created by will be empty:

  1. You create a thing from the App data tab

  2. You create a thing from an unauthenticated api endpoint

I’m not aware of anyway to modify that field (nor the created/modified dates.)

1 Like

Yes, those objects were created by the system (as in, you created them in the data tab).

Aside: this is a bit odd. It does seem like “system” should be a user. But then, it’s the only user without a unique ID so I guess “null” is that “user’s” identifier.

@mebeingken, I did not realize that this situation might also be caused by your item number 2. Interesting.

In most cases I’ve seen, it’s because the user that created them was deleted. Happens a lot when you’re testing with a bunch of throwaway users/data in general.

1 Like

Also interesting! In my own app, I’m much more likely to be the source of Creator-less objects as I do a lot of system-variable type stuff.

(For anyone that doesn’t grok what I’m going on about, let’s say you need a list of things that you want to refer to. Like the names of days of the week. You create a data type called Day of Week Names or some such. This data type has an index and a name field. Since it’s so simple, and you only need 7 of them, you just create them in the App Data interface, rather than building your own admin interface for this. All of those things will have no Creator – they were created by the system.

@romanmg’s observation is very interesting. As your app grows and perhaps you have users delete their accounts, if you don’t clean up after them [delete everything they were the creators of] you will have a growing number of Creator-less things in the database.)

1 Like

Another case is where a user isn’t logged on and creates a row.

4 Likes

I just learned 2 seconds ago after pulling my hair out a bit why a privacy feature “when this Y’s creator does X” is the User did not have an email address, they logged in using LinkedIn and we don’t take the email from them to create their account.

Hopefully this helps someone in the future. Now, I’m creating a fake 9 digit email for them