


However, in my current scenario, it is rare that a file requires the full 6-tier level of categorization. That was acceptable when there is always a static number of filing tiers (i.e., in this example if there was always 6 tiers of categorization for every file). I have worked around this issue in other Power Automate activities by simply duplicating the last folder tier in the file path, thereby leaving an empty final tier folder in the folder of the same name (e.g., Folder path: "Tier 1/Tier 2/Tier 3/Tier 4/Tier 5/Tier 6/ Tier 6"). However, it instead saves the file in the folder that is one folder level HIGHER (which in this example is "Tier 5 - TEST 20191226 02") (see Exhibits G and H). Using the example provided below in Exhibit F, this should save the created file INSIDE the folder "Tier 6 - TEST 20191226 01." The PowerApps form writes the record to the SharePoint list (Document Log), which triggers the Power Automate activity flow.

The "Create file" action directs the file to be saved to the "Folder Path" that was generated in the "Create new folder" Folder Path using the Dynamic Content from the Trigger Action ("When a new item is created"). The "Get attachment content" and "Create file" actions are embedded in an "Apply to each" loop that Power Automate automatically created, even though the PowerApps form restricts the file attachment field to a single file for each item saved to the Document Log SharePoint list (see Exhibit E). Once the Power Automate trigger occurs (i.e., saving the new item created via the SharePoint list PowerApp), a "Create new folder" action in Power Automate creates a folder (if not already created) in the Document Repository using the Dynamic Content for SharePoint Document Log list column data for the Tier 1 through Tier 6 columns to define the Folder Path (see Exhibit D).įollowing the "Create new folder" action, there are actions to "Get attachments" and "Get attachment content" from the SharePoint list item, and a "Create file" action. The last list detail that might be relevant to the Power Automate question is that when the PowerApps new form is saved, the PowerApps form writes the final tier selections back to the SharePoint Tier 1 through Tier 6 list columns, which are merely single lines of text (see Exhibit C).

The user must also attach a file in the PowerApps form "Attachments" field that will be copied to the Document Repository to a specified file path (discussed below), and then deleted from the SharePoint list item, all through the Power Automate sequence (see Exhibit B).
#Create clean text file series
The PowerApps form has an initial Tier 1 selection followed by a series of five cascading drop-down tiers to allow multiple levels of categorization for the file that is being added to a Document Repository (library). I have a Power Automate sequence tied to a SharePoint list via the trigger "When a new item is created." The SharePoint list is a Document Log that uses a SharePoint list derived PowerApps form to designate up to six levels of filing structure information (see Exhibit A). Hoping the community can help after my many hours of searches have come up empty.
