Hi @Aishwarya_Bhargava !
You can use the following function to extract all the subfiles from an original folder, independently if it is a local folder, or a synced sharepoint folder:
· var_FolderPath = Local path to extract files from.
· "*.*" = filter. If you'd like only PDF's for example, this would be "*.pdf*".
· SearchOption.Alldirectories = In order to look for files inside subfolders also.
This will not give you the desired structure you pasted on the 2nd screenshot, but will give you an array of strings, with the full path to each file:
C:\Users\User\OneDrive - DemoFolder\Documents\\FolderA\FolderAA\FileA.txt
C:\Users\User\OneDrive - DemoFolder\Documents\\FolderB\FileA.txt
C:\Users\User\OneDrive - DemoFolder\Documents\\FolderB\FileA_1.xlsx
C:\Users\User\OneDrive - DemoFolder\Documents\\FolderC\FolderCC\FileCC1.txt
C:\Users\User\OneDrive - DemoFolder\Documents\\FolderC\FolderCC\FileCC2.pdf
With this list of final paths, you can manipulate the strings to get your desired DT output. But might be worth to leave it like this, if it suits your automation.
Other useful expressions you can use to extract filenames from this array of strings:
-> This would return exactly "FileA.txt" from the 1st value in our example.