Automation script to find matching fields and link records

Hi! I’m trying to figure out how to extend an automation that works for one record to make it work on 200 records. I have 2 tables, which are linked. Several records from table B are linked to each record from table A. Records in table B have duplicate descriptions, but different codes, so I’d like to set an automation that links all matching records from table B when one record is linked to a record in table A. I was able to make an automation triggered by a field in a table A record, which finds records in table B with the condition being that the description matches, then updates the record from table A with the list of records from table B. This works well and would be simple enough to replicate for my ~200 records. However, the 25 automations limit means I can’t do that. I’m struggling to somehow script this to work for many records as the conditions I’ve entered are the specific code and description for one record from table B. Any help would be very much appreciated.