Fetching multiple Entry IDs from Cognito Entries that match a Lead Ref

I thought this would be easy but I am struggling to work out how to fetch multiple records from a Cognito form’s entries.

I need to fetch multiple IDs so that I can then update each entry.

The scenario I want to build is as follows;

  1. When a new entry arrives into the form named “Install Dates” get the “Lead Ref” from the latest entry.
  2. Using that Lead Ref, find all entries from the “Job Bids” form that have a matching Lead Ref and return their entry IDs.
  3. Using the array of Entry IDs, update each of the Job Bids entries.

I’ve trawled through the forums, searched here and the web, and can find no examples to demonstrate how to get multiple records that match a variable.

I’ve tried using the Repeater module but it asks for a number to set the amount of repeats, yet I won’t know this. When I try to find the Entry ID based on the Lead Ref, I get just one result.

Any assistance is greatly appreciated, thank you!