sharepoint-online

Flow is getting failed-path for the new folder is not valid


I have uploaded the below excel in sharepoint document library in order to power automate to create folder structure

Note:im only able to create 2 levels of folders dynamically and remaining subfolders were not getting created Please note i need to create above excel details in the nested folderĀ  into my sharepoint document library

enter image description here

Flow steps

enter image description here

Expanding Applyto each step enter image description here

enter image description here

Expanding Apply to each step enter image description here

enter image description here

enter image description here


Solution

  • you need to normalize your data. There are rows where the "Year" is empty, which means, the PowerAutomate try to create folders without name. Anyway, you should put a backslash ("/") before the "Year": enter image description here I recommend, to put the output of the action "List rows present in a table" into two different array: a year, and a month, then remove the duplicates (like

    union(variables('varYear'),variables('varMonth'))

    ), then create the folders based these array's elements.