web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / SUBJECT: "Create New F...
Power Automate
Unanswered

SUBJECT: "Create New Folder" followed by "Create File" action in the new folder places new file in Folder Level one level too high

(0) ShareShare
ReportReport
Posted on by

First time poster - First time necessary.  🙄

 

Hoping the community can help after my many hours of searches have come up empty.  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 structured information (see Exhibit A). 

 

The PowerApp follows the initial Tier 1 selection with a series of up to five cascading drop-down tiers.  The user also must attach a file in the PowerApp form “Attachments” field that will be copied to the Document Repository (a SharePoint Document Library) to a specified file path (discussed below), and then deleted from the SharePoint list item (but adding a hyperlink to a hyperlink column in the list to the file location in the Document Repository so users can locate the document later by either searching the list or the Repository) (see Exhibit B). 

Exhibit B - Cascading Tiers for Folder Structure.png

The last list detail that might be relevant is that when the PowerApp new form is saved, the PowerApp 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).

 

 

EXHIBIT CEXHIBIT C

 

Once the Power Automate trigger occurs (i.e., saving the new item created via the SharePoint list PowerApp), a “Create new folder” action creates a folder (if not already created) in the Document Repository using Dynamic Content to define the Folder Path by using the six (or fewer) tiers selected by the user in the PowerApp / SharePoint list form (see Exhibit D).

 

EXHIBIT DEXHIBIT D

 

Following the “Create new folder” action, there are actions to “Get Attachments” and “Get attachment content” from the SharePoint list item generated through the PowerApp form, and a “Create file” action.  The “Get attachment content” and “Create file” actions are embedded in an “Apply to each” loop that Power Automate automatically created, even though the PowerApp form restricts file attachment to a single file for each item saved to the Document Log SharePoint list (see Exhibit E).

 

EXHIBIT EEXHIBIT E

The “Create file” directs the location to create the file 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 PowerApp form writes the record to the SharePoint list (Document Log), which triggers the Power Automate activity flow.  Using the example provided below in Exhibit F, this should save the file INSIDE the folder “Tier 6 – TEST 20191226 01”

 

EXHIBIT FEXHIBIT F

 

Instead, it saves the file in the folder that is one folder higher (which in this case is “Tier 5 – TEST 20191226 02”) (see Exhibits G and H).

 

EXHIBIT GEXHIBIT GEXHIBIT HEXHIBIT H

 
 

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”).  That was sufficient when there is always a static number of filing tiers (i.e., in this example if there were always 6 tiers of categorization for every file).  However, in my current scenario, it is rare that a file requires the full 6-tier level of categorization.  Using the workaround described above would result in me having to nest six conditions to accomplish that workaround, which makes me think that in addition to being a clumsy expectation to have to build a dangling extra, duplicative folder tier for each categorization tier, there must be something I am missing in configuring the “Create a new folder” action. 

 

Any ideas, community?  Thanks in advance.

Chris.

Categories:
I have the same question (0)

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 462 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 456 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard