Need:
I have the need to dynamically decide to which Folder/Subfolder in a Library an attachment is uploaded.
Background:
I have a Flow that creates a Folder and Nested Folders whenever a new item is created in a SharePoint List.
This function works fine.
I, also, have a Flow that is uploading attachments to a specific Subfolder. That function works fine.
I would like the ability to upload the attachment to a specific Subfolder assoicated with the name of the individual, as chosen in the Gallery. All attachments should be routed to the Root folder associated with the name of the client, and uploaded to the Subfolder associated with the 'type' of document being uploaded.
Components:
My 'Upload Attachments' button has the following formula -
UploadClientAttachmentsFlow.Run(Upload_Client_ID_Fld.Text,Label15.Text,TextInput1_3.Text,
{ file: {
contentBytes: First(Client_Attachments_Control_2.Attachments).Value,
name: First(Client_Attachments_Control_2.Attachments).Name
}
});
The user has the ability to choose, from a Dropdown box, the type of attachment being uploaded. That choice is also used in the naming of the file when it is uploaded to the Library.
Example:
If the user wants to upload a 'Drivers License' (as chosen in the Gallery), related document associated with client 'Olive Oil' (as chosen in the Gallery), the Flow should route the document to the Root folder for 'Olive Oil' and add it to her 'Drivers License' subfolder.
My Power Apps Attachment Upload Gallery -

My 'Upload Attacments' Flow -

My preferred upload folder/subfolders -

