You don't have any kind of Lookup columns on the SharePoint list to help keep these Item's together with a key pair? If you had a lookup column in the doc lib, that referenced the hazards, then you could look up the hazard name, then it would be much easier to just match there, then have a separate column for the date, or does everyone not want to put in metadata and just upload files based on name?
You could also use Flows to set metadata for you.
Anyway, to match those by name as is you could try the following. (Don't know if you would have delegation issues or not, but worth a test)
So what I'm doing here, assuming all filenames have an underscore after the hazard, is temporarily for the filter appending an underscore to the selected Hazard, this way when it goes to match, StartsWith Hazard 1_06_etc would match Hazard 1_ and not Hazard 11_ etc.
Don't have a test setup to test, but off top of my head that should technically work, just dont' know about delegation.
Best Response confirmed by
Gavin Squires (Occasional Contributor)
Hi @Chris Webb , thanks for your reply. I hadn't thought about the lookup column. Sometimes it just takes someone else's point of view to change things. I've now added some meta data and have a linked column. It now works perfectly and no delegations issues.