Update a value based on another table's column

I’m trying to update the ID number for a person based on the ID entered on another table

I have a table named attendance with the data: [key, [person], [meal1], [meal2], [meal3], [documentid])
I have another table called people with the data [key], [name], [documentid]

I have a database of 5,000 people but for a 30% of them the [documentid] for me is unknown (null) I want to update the value in people.[key].[documentid] based on the attendance table

Currently in the table attendance, when the documentid retreived from people[key].[documentid] is empty, displays the column attendance[documentid] but the column in people[key].[documentid] is not updated (I don’t know how to) so the documentid is left over only in the table attendance[documentid]

You want to update this value when? When a new attendance record is added?

I think you need a “Reference Action”. There is an action type called “Data: execute an action on a set of rows”.

First you create an action in your people table to set the [documentid] column. You’ll probably need to reference the VC list of “Related attendances” to find the value.
Second, you create the reference action, which triggers the first action.

1 Like

When the attendance record is updated.

Alright, I’ll try to mix those actions.

In that case, you can try to set the reference action as the “Form Saved” action on the attendance_form view.

1 Like