Created By Field

If I enter a new row of data at the database level, it logs who made the record in the created by field. However, I have created a ‘portal’ for users to enter data using a view of the data entry form. When a user enters a new record, I cannot tell who entered it. You do have to logon to the portal using email and password. How can I record who entered the record from the portal?

Hello,

The Created by field is only for database users. Users from the application cannot appear in this field. The Created by can also not be addressed in formulas. You can use the following workaround:

  1. Create a boolean field that is set to true when a record is created from the portal and false if it is created from the database.
  2. Create a single text field that holds the e-mail or username from the authenticated user.
  3. If a new record is created from the portal you can fill in this field from the application builder with the authenticated user.

I am not sure how this works … I have a table called ‘Rolling Stock’ which is where the actual records are created. I have separate table ‘Members’ where the Member’s email (email field called email) and password field is kept. Users enter new records from the portal through a form embedded in an iFrame. How can I set the field to true when user enters record? Thanks!

Users enter new records from the portal through a form embedded in an iFrame

You need to create the form with the app builder. When you have created the form, you can link one or more action to the submit event.
image

If your table has a field to store the name of the user, you can fill this in with the username or e-mail of the authenticated user.
If your table has a field to indicate that the record comes from the portal, you can hard-code this to true in the Create row event.
image
image

I just noticed the similar topic: Created By Not Populated in App Builder.

You can indeed use the solution that @jrmi proposed. What you need to do is checking in the form what the name of your linked field to the Members table is. Let us assume that it is: Members. Next, you check what the first column (or primary key) is for this field. Assume that this is the e-mail address. Then, you can create the following URL:
http://link-to-your-form?prefill_Member=User>e-mail

This will prefill the Member field. Is this works, you can hide the field by adding &hide_Member to the url.

You can find more information about prefilling forms at How to prefill forms dynamically with existing data // Baserow.

I think the best approach is trying to prefill the form first by adjusting the URL before embedding it in the application builder.