Populate new record's "created_by" field with the ID of the current user

14 views
Skip to first unread message

Rob Hills

unread,
Dec 24, 2025, 6:38:12 AM (2 days ago) Dec 24
to Jam.py Users Mailing List
I would like to populate the "created_by" field value in my tables with the ID of the currently logged in user.

Is there a way to do this from within the Application Builder interface?  Or do I need to code it with Javascript?

Drazen Babic

unread,
Dec 24, 2025, 8:00:24 PM (2 days ago) Dec 24
to Jam.py Users Mailing List
That's what History is for imo.

On Wed, 24 Dec 2025 at 7:38 pm, Rob Hills <rcp....@gmail.com> wrote:
I would like to populate the "created_by" field value in my tables with the ID of the currently logged in user.

Is there a way to do this from within the Application Builder interface?  Or do I need to code it with Javascript?

--
You received this message because you are subscribed to the Google Groups "Jam.py Users Mailing List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jam-py+un...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/jam-py/a53d5961-812f-4d6f-ae0e-79a68615c8b1n%40googlegroups.com.

Rob Hills

unread,
Dec 24, 2025, 10:55:04 PM (2 days ago) Dec 24
to Jam.py Users Mailing List
Yes, the "History" functionality in jam.py is very nice.  However, I am porting a legacy application so I need to continue to update this column in the existing database.

I've worked out that if I modify the client-side on_edit_form_created (item) event as follows...

function on_edit_form_created(item) {
<.. existing code left alone ..>
/* Set the "created_by" field value to the current user if not already set */
var created_by_field = item.field_by_name("created_by")
if (created_by_field) {
if (!created_by_field.value) {
created_by_field.value = item.task.user_info.user_id
}
}

This sets the "created_by" field value to the currently logged in user ID as I wanted.  However, nothing displays in that field on the edit form.

My "created_by" field is a lookup field (linked to my "users" table). Is there a method I can use to get this field to refresh its lookup value so it displays on the edit screen as expected?  I hunted using my javascript debugger but couldn't find anything.

Drazen Babic

unread,
Dec 25, 2025, 4:56:33 AM (yesterday) Dec 25
to Jam.py Users Mailing List
Reply all
Reply to author
Forward
0 new messages