Hi @nedwards87 ,
If the files name are always in the same format, please try if the following way will work for you.
In this scenario, the file name will be the format likes “X0881Document”, I then get the key number 881 from the name and use it as the folder name. If a folder of name 881 already exists, the file will be created automatically, else, create the folder first, then create the file.
The function used in the Compose action:
substring(items('Apply_to_each')?['Name'],2,3)
An image for your reference:

Further, you could also try with what you’ve mentioned in your original post,, using an Excel or SharePoint list that contains the information needed including the filename, filepath. Then adding a condition to check if the attachment name contains the filename, if yes, create the file to the corresponding filepath.
Best regards,
Mabel