Although list attachments are not recommended in a SharePoint list, sometimes the customer has a need for this SharePoint feature. This Microsoft Flow uses a list form with an attachment which then adds the attachments to a SharePoint library with the selected metadata.
Step 1
Create the library and the list with the same metadata. The library needs to have the same columns the list has for clarity.
Step 2
Create the Flow.
1. The trigger is going to be when an item in the List is created.
2. Retrieve the attachments from the list.
3. Add an Apply to Each using the Body from Get attachments.
4. For each attachment we want to retrieve the content, create the file in the library, and update the file’s properties.
5. When retrieving the attachment content we want to use the ID from the item created and match it to the Id File identifier from Get attachments.
6. Create the file in the Folder path using the DisplayName and Attachment Content.
7. Use the ID from the created item, then update the file metadata with the columns from the List. These columns/metadata can be configured as your own, but should be the same on both the List and the Library.
8. All Done!
Modern List form
Attachment
File created and moved to the SharePoint library with the metadata