Create an Automation that monitors change within the Linked Field, then you’ll need to run a script that’s similar to this;
In this example, the linked field is a “Tags” table, that the main “Products” table links to - which is from a previous example I gave in another thread.
//Get the record with the "Tag" field change
const inputConfig = input.config();
const productsTable = base.getTable("Products");
const myRecord = await productsTable.selectRecordAsync(inputConfig.recordId);
if (myRecord.getCellValue("Tags").length >= 4) {
let lastThreeRecords = myRecord.getCellValue("Tags").slice(myRecord.getCellValue("Tags").length-3, myRecord.getCellValue("Tags").length);
await productsTable.updateRecordAsync(inputConfig.recordId, {
"Tags" : lastThreeRecords
})
};