Skip to main content

Selecting a process attachment

This sample process shows how all files of a specific type (in the example: PDFs) can be selected from several uploaded files and made available to the following process steps as a process variable. The sequence illustrates the interaction of File Upload, Loop start, Condition and Set variables value.

The goal of the process is to select all PDFs from the uploaded files and make them available to the downstream steps via a process variable. This allows a process to work with specific attachments without the person running the process having to forward the files manually.

The example is intentionally kept simple and assumes that you have completed the Quick Start.

Process overview​

The process starts with a form in which one or more files can be uploaded. A loop over the uploaded files is then started. In each loop iteration, a condition checks whether the name of the current file contains the extension .pdf. If this is the case, the current file is added to the process variable Datei. After the loop has finished, all recognized PDFs are stored in the variable. A second form then displays the files stored in the variable.

The individual steps are explained in more detail below.

Form: Datei Upload​

In this form, the persons upload the files from which the PDFs are to be selected. The files serve as the source for the subsequent selection; they can also come from other sources, for example from the attachment of an email. The form consists of the following controls:

  • File Upload (display name DateiUpload):
    With this File Upload control, one or more files are uploaded. In the configuration, the file type PDF is enabled for editing in the browser.
  • Button:
    Via the Button, the persons continue the process into the loop.

Loop over the uploaded files​

The Loop start action repeats the following steps for each uploaded file:

  • Loop value:
    The list of uploaded files of the File Upload control is selected as the loop value.

The loop is terminated by the Loop end action.

Condition: Ist PDF?​

Within the loop, the Condition checks whether the current file is a PDF:

  • Display name:
    Ist PDF?
  • Select value:
    The current entry of the loop (the file), referenced via the Loop start node.
  • Select operator:
    contains
  • Select comparison value:
    .pdf

If the condition is met, the output port Ist PDF? is followed and the process variable is extended. If no condition is met, the output port Else is followed directly to the loop end.

Process variable Datei​

The variable Datei with the data type Datei is created in the Variables Panel of the process.

The Set variables value action extends the variable with the current loop value:

  • Variable:
    Datei
  • New value:
    The variable Datei itself and the current entry of the loop (the file), referenced via the Loop start node.

The current value of the variable is taken as the starting value for each assignment and the current loop value is appended to it. After the loop has finished, all files recognized as PDFs are therefore stored in the variable. If no file is recognized as a PDF, the variable remains empty.

Form: Anzeige der Dateien​

After the loop has finished, the second form displays the files stored in the variable:

  • File preview:
    The File Preview control displays the files stored in the process variable Datei. This allows the persons to view the selected files directly in the browser.

Summary & Outlook​

Via the process variable, the selected files are available to all downstream process steps. The current value of the variable can, for example, be displayed in a dashboard or passed to another process.

It would also be possible to feed the selected files into a further step, for example by forwarding them as an attachment via a Send email action.