{{ transformations:FolderListAction.png}}
====== LIST OF FOLDERS ======
Category: Create / Generate\\

\\ 
=====Description=====
This action creates a table with a list of folders in the specified folder.\\

\\ 
=====Use cases=====
Such a table can be used later for iterations, folder commands, and/or file commands.\\

\\ 
=====Action settings=====
^ Setting  ^ Description  ^
|Folder<sup>*</sup>|The folder to extract the list of //direct// subfolders from.|
|Columns|Provides options to select the types of data to return as fields in the dataset.  See below.|
|Subfolders|Provides options to scan through subfolders within the chosen folder.  See below.|
<sup>*</sup> Setting can be specified using a [[:parameters|parameter]].\\
\\ 
====Columns settings====
These options define the columns that will be included in the generated dataset. At least one option must be selected. 
^Option^Description^
|Folder name with pull path|Returns the fully-qualified folder name including absolute path.  Default.|
|Folder name only|Returns the folder name only, excluding path.|
|Date created|The date the folder was first created.|
|Date modified|The date the folder was last changed or updated.|
|Read-only|Returns a "true"/"false" value signifying whether the folder is flagged as read-only (TRUE) or read-write (FALSE).|

\\ 
====Subfolders settings====
^Option^Description^
|Scan subfolders|Check this option to scan subfolders under the selected Folder.|
|Scanning depth|The number of subfolder levels, under the parent folder, the action will scan within.  e.g. "1" will scan through the\\ subfolders found //directly// under the parent folder only; "2" will scan through the subfolders of the subfolders\\ (i.e. 2 levels deep) found under the parent folder.|
|Ignore scan errors|Select to ignore any errors produced when scanning subfolders for files.  This is useful for avoiding errors when\\ scanning folder depths that may not exist in all subfolders.|

\\
=====Examples=====
====Example #1====
>Create a list of folders in the Documents folder.

===After (result table)===
^Folder name only ^Date created ^
|**MyFiles**  |  **2023-02-06 9:02:26 PM**|
|**YourFiles**  |  **2022-11-21 11:52:32 AM**|
|**TheirFiles**  |  **2024-04-07 1:38:18 PM**|
|**OurFiles**  |  **2024-10-25 8:38:53 PM**|
===Action parameters===
>Folder: C:\Documents
>Columns: Folder name only, Date created

\\
====Example #2====
>Create a list of folders in the Public Datasets folder and the subfolders directly under them.
===After (result table)===
^Folder name with full path ^Date modified ^Read-only ^
|**D:\Public Datasets\US Household Income**  |  **2023-12-07 1:38:18 PM**|  **FALSE**  |
|**D:\Public Datasets\US Household Income\Archives**  |  **2023-12-07 2:40:02 PM**|  **FALSE**  |
|**D:\Public Datasets\Historic wreckage data**  |  **2023-10-04 11:11:11 AM**|  **TRUE**  |
|**D:\Public Datasets\HTML resources**  |  **2025-01-25 11:06:42 AM**|  **FALSE**  |
===Action parameters===
>Folder: D:\Public Datasets
>Columns: File name with full path, Date modified, Read-only
>Subfolders: Scan subfolders
>Scanning depth: 1

\\ 
=====Community examples=====
  * [[https://community.easymorph.com/t//2156/1|How to process parent-child data structures]] ([[https://community.easymorph.com/uploads/short-url/zmylfn4Qr0ovzu3e5rybl0LVMNG.morph|Project]]; Module: //Scan 1 folder//; Group: //Tab 1//; Table: //Desktop//; Action position: //1//)

\\ 
=====Shortcuts=====
Fast ways to create the action:
  * Press the "Add data" menu button. Pick "Generate data".
  * Drag a folder with subfolders into the application window.  Select "Generate a list of folders in the folder".

\\ 
=====See also=====
  * [[transformations:filelist|List of files]]
  * [[transformations:iterate|Iterate]]
  * [[transformations:iterateprogram|Iterate external program]]
