Skip to main content
Version: 1.28 (Current)

Synchronize Folder

Audience: Low-code Engineers

Skill Prerequisites: File system basics

Synchronizes the site's file system (the list of files and folders Plant an App knows about) with the files that are actually on disk. Files and folders that were added directly on the server show up in the Files interface and file pickers, and files that were removed from disk are removed from the list.

This is the automated version of the Sync button in the Files interface.

Typical Use Cases​

  • After Unpack an archive, which writes the extracted files straight to disk
  • After an external process drops files into a portal folder, for example an integration or a script that writes files over FTP
  • After custom code, such as a scheduled script, writes files directly to disk
  • Scheduled synchronization of folders that are updated outside Plant an App

Don't use it to​

  • Create a new folder. The folder you synchronize must already exist in the file system. Use Get or Create Folder instead.
  • Synchronize the whole site as a routine step. A full synchronization can take a long time on sites with many files. Target the folder you changed.
Action NameDescription
Unpack an archiveExtracts an archive to disk. Follow it with this action so the extracted files can be used.
Get or Create FolderRegisters a folder in the file system, so it can be synchronized.

Input Parameter Reference​

ParameterDescriptionSupports TokensDefaultRequired
Folder PathThe folder to synchronize, relative to the portal root (for example Imports/2026/). Leave empty to synchronize the portal's entire file system, including all subfolders.Yesempty stringNo
Synchronize SubfoldersWhen checked, all subfolders of Folder Path are synchronized too. When unchecked, only the files and immediate contents of Folder Path are synchronized. Ignored when Folder Path is empty.NoUncheckedNo

Considerations​

  • The folder must be registered. If Folder Path exists on disk but not in the file system, the action fails with The relative path provided for synchronization does not exist in the virtual file system. Synchronize its parent folder with Synchronize Subfolders checked, or create the folder first with Get or Create Folder.
  • Broken folder entries. If a folder in the path has an invalid parent entry in the database, the action fails and names the folder. Fix the folder structure in the Files interface before trying again.
  • The action doesn't produce output tokens.

Examples​

tip

To understand how to use the below examples, please see Running Examples.

1. Unpack an uploaded archive and synchronize the result​

The first action makes sure Imports/ is registered in the file system. The second action extracts the archive uploaded in the Package field into it. The third action synchronizes Imports/ and its subfolders so the extracted files can be used by other actions and seen in the Files interface.

[
{
"Title": "Get or Create Folder",
"ActionType": "GetOrCreateFolder",
"Description": "Make sure the Imports folder is registered",
"Condition": null,
"Parameters": {
"FolderPath": {
"Expression": "Imports",
"Value": "",
"IsExpression": true,
"Parameters": {}
},
"FolderMappingConnection": {
"Expression": "",
"Value": "",
"IsExpression": false,
"Parameters": {}
},
"OutputTokenName": "ImportsFolder"
}
},
{
"Title": "Unpack an archive",
"ActionType": "Unpack",
"Description": "Extract the uploaded package",
"Condition": null,
"Parameters": {
"ArchiveFileField": {
"Expression": "",
"Value": "Package",
"IsExpression": false,
"Parameters": {}
},
"OutputDirectory": {
"Expression": "",
"Value": "/Imports",
"IsExpression": false,
"Parameters": {}
},
"CopyNonArchives": false,
"CreateFolderPath": false
}
},
{
"Title": "Synchronize Folder",
"ActionType": "FileManagement.SyncFolder",
"Description": "Register the extracted files",
"Condition": null,
"Parameters": {
"FolderPath": "Imports/",
"Recursive": true
}
}
]

Revised 09/25/2026