I am trying to get a list of folder names in an array format.In order to do this, I used the Directory.GetDirectories(“”) method to fetch the path for all the folders in a certain directory and saved it to a string variable.
Then I loop through each object within the string variable called item. I am trying to get the LastIndexOf() of the path ‘\’ for each item object so I can then get the pure foldername without the slashes (\) in the path.
However,I keep getting the following error in the exclamation mark:
‘object.ToString()’ is a method, which is not valid in the given context
For eg :-
lets say From the above img you want the folder names like Dummy Folder 1, Dummy Folder 2, & Dummy Folder 3 to get store in some string variable one by one
“(?<=List of Retail Folders\).+”
In the above regex instead of “List of Retail Folders” you have to edit the folder name as
“(?<=EDI Trading Partners\).+”
And below is the workflow which returns the array of all the subfolder names Main1.xaml (10.1 KB)
Hope this workflow may help you to solve your issue