Using Variables in Workflows


You can make your workflows more robust by adding variables to them, for example, to:

  • Insert a new file into a folder named with the current date.
  • Send an email to a reviewer with the name and path of a file that requires review.
  • Send an email with the share name and share owner to an auditor when a share is approved.

You can either create variables or use file, user, or system metadata as variables (for example, file size, file creator username, and current date). 

The following procedures show you how to set up some of the scenarios described above, but these are only a starting point.  Use variables to add any functionality and information to your workflows that is useful to you.

Here, we'll show you how to make it easy to find files created on certain dates by storing them in folders named with the create date. This could be useful, for example, if you want to keep track of when certain files were uploaded to a team folder.

  1. Initiate the workflow by choosing the trigger Automatically on a file activity.
  2. In Limited to Path, choose the folder path where the files are uploaded or created and in File Event, select If a file is created, and click Add.

  3. Drag and drop a Create Directory step onto the workflow.
  4. Set the Target Path to the parent path where you want the file to be copied, and then add "/", and then click +.
    The Insert Variables box opens. 
  5. Click the Context tab, then hover over Current date and click Insert.

    Current date is inserted after the parent path.
  6. Click Save to save your Target Path.
  7. Drag and drop a Copy File step onto the workflow after the Create Directory step.
  8. Into Source Path, enter 
    ^_file.path^
    to indicate the file path + the filename.
  9. Set Target Path to the exact value that you used for Target Path in the Create Directory step (choose the parent target path and add "/", then click + and insert the Current date variable.
  10. Click Save to save your parameters.
  11. Give your workflow a name, and click Save Workflow.

Let's see how this works when we upload a file into the source path. In the following video, we add the file About FileCloud to our Marketing team folder. We can see that the workflow functioned correctly - it added a folder named with the date to the My Files/Review folder and copied the About FileCloud folder into it. 

In this example, after a share has been approved, we'll have a workflow send an auditor a notification that includes the name of the share and the share creator.

  1. Create a Share Approval workflow.
  2. Edit the workflow, and add a Send Email step after the Share Approve step.
  3. In To, enter the email address of the auditor.
  4. In Subject, enter a descriptive subject, such as Information has been shared.
  5. In Body, enter The share, and click +.
    The Insert Variables dialog box opens.
  6. In the Start Event tab, hover over Share path, and click Insert.

    The variable Share path is inserted into Body.
  7. After Share path, type has been shared by, then click + again.
  8. In the Start Event tab of the Insert Variables dialog box, hover over Share owner username, and click Insert.
    The Body of the message is complete. 
    The parameters for the Send Email node appear as:


  9. Click Save under Body.
  10. Give your workflow a name, and click Save Workflow.

When an approver approves a share, the following email is sent to the auditor in the To address. It includes the share path including the filename and the share owner.