For Each File

This activity runs the activities inside it on each file in a collection. Generally, you will want to use this activity with a collection of files attached to a Laserfiche Form  (retrieved with the Retrieve Laserfiche Form Content activity). See the tokens this activity produces.

Tip: To bring Laserfiche Forms attachments into Laserfiche, place a Create Entry and an Attach Electronic Document activity inside the For Each File activity, and configure the Attach Electronic Document activity to attach the file currently being processed by the For Each File activity to the entry created by the Create Entry activity. ClosedShow me what this looks like.

ClosedHow does this activity look in the Designer Pane?

To add this activity to a workflow definition

To configure this activity

Drag and drop activities into this activity.

Select the activity in the Designer Pane to configure the following property boxes in the Properties Pane.

Tokens for For Each File

The For Each File activity makes the following tokens, which are available to any activities placed inside it. The For Each File activity runs once per file and each time it runs, the token values below will reflect the information relevant to the file it is currently processing.

Name Description Sample Syntax*
CurrentFile_MIME Type

The MIME type of the file.

Example: application/xml

%(ForEachFile_CurrentFile_MIME Type)
CurrentFile_Path

The path of the file in its original source location.

Example: Collection\Files\1 or C:\myFiles

%(ForEachFile_CurrentFile_Path)
CurrentFile_Folder Name

The name of the folder that the file is in in its original source location.

Example: FilesInCollection (LF Forms) or C:\myFiles (Windows)

%(ForEachFile_CurrentFile_Folder Name)
CurrentFile_Name

The name of the file without its extension.

Example: MyDocument

%(ForEachFile_CurrentFile_Name)
CurrentFile_Extension

The file's extension.

Example: .xml

%(ForEachFile_CurrentFile_Extension)
CurrentFile_Full Name

The name of the file including its extension.

Example: MyDocument.xml

%(ForEachFile_CurrentFile_Full Name)
CurrentFile_Size

The size of the file in bytes.

Example: 71168

%(ForEachFile_CurrentFile_Size)
CurrentFile_Source ID

The unique identifier for the file when retrieving it from the file's source.

Example: 5 (LF Forms) or C:\myFiles\MyDocument.xml (Windows)

%(ForEachFile_CurrentFile_Source ID)
CurrentFile_Source Name

The name of the file's source (i.e., where the file came from).

Example: http://myserver/forms or C:\ or \\computer\C$

%(ForEachFile_CurrentFile_Source Name)
CurrentFile_Category

The type of the file in its source location.

Example: File (Windows) or Attachment (LF Forms)

%(ForEachFile_CurrentFile_Category)
CurrentFile This token is replaced by the current file when the activity runs. This token only appears where file tokens are allowed, such as in the Form Data property of a HTTP Form Post activity. %(ForEachFile_CurrentFile)
Iteration The number of times the For Each File activity has run. %(ForEachFile_Iteration)

*The "ForEachFile" portion of the syntax changes to match the activity's name as specified in the Activity Name property box. Note that all non-alphanumeric characters, except underscores, are removed from the name.

Example: If you rename the activity Apply [Settings] to Each, the syntax for the CurrentFile_Source ID token will be %(ApplySettingstoEach_CurrentFile_Source ID).