Hi,
Link all table1 records to the table 2 record (fill first by hand, then copy-paste it to the whole column).
Use Count field type in table 2.
Create automation that will trigger in table 1 when record match condition - link is empty.
Set action - fill link field with static value (linking to the record in table2)
If you need to preserve your 'voucher' number field, add second action - copy value from count to voucher.