Update / Delete linked record on list using hidden fields

I have an Airtable database that has 4 tables:

User
Job Family
Functional Focus
Responsibility

like this:

Each table is linked via linked fields in a hierarchy Job Family → Functional Focus ->Responsibility, and then using Softr lists, a user can select what Job Family they belong to, then functional focuses then responsibilities etc…

i.e.:

Using hidden fields in buttons on a Softr list, I can send the UserID to each table to link the record to the user using an Update.

i.e:

The problem I have is that I’m not able to remove a user from a linked record in a table using the same update method. I don’t want to delete the record, just add and remove the UserID from the linked records in each table.

I am able to remove records using a Make integration, however, using lists there is no way to call Make, so the UX is compromised with workarounds.

I’ve played with the idea of creating a column on the table i.e. “Remove Functional Focus”, and then updating to this field, then running a script automation in airtable , however I haven’t had any luck getting this script to work … it’s driving me a little insane.

Would anyone have a solution here??

Just my update here for anyone else interested… Kind of working.

I have been working on the hidden field of the UserID to a “Remove Action” column, that then has an automation in Airtable that removes the link to the User Record with this code in the Airtable script when the UserID is added to the “Remove Action” column:

const inputConfig = input.config();
const ffTable = base.getTable("Functional Focus");
const myRecord = await ffTable.selectRecordAsync(inputConfig.recordId);
if (myRecord.getCellValue("User") != null) {
    let removeUserRecord = myRecord.getCellValue("User").filter( record => (record.id != inputConfig.userId));
        await ffTable.updateRecordAsync(inputConfig.recordId, {
            "User" : removeUserRecord
        });
}

The only problem I have now is that it takes the best part of 10 seconds to run the script and the list on Softr now updates before Airtable has had a chance to do the work …

Anyone has any other ideas??

Hi!
Not sure about your use case but action buttons will be able to trigger webhooks soon (make and zapier).
There is a community event this afternoon about action buttons with Artur, CTO of Softr. This might be of interest for you (there will be a replay)

1 Like

@thegarty Hi Tom, I’m running into some linked record update headwinds … I cannot find the Update Record Action Button you’re using in any of the List blocks that I’ve tried. All I can seem to get is One Click Update. Where did you find the ‘Update record’ option?
Thanks
Jason