Customizing Destination Filenames


When setting up Destination filenames in Automations, you may include pattern characters that will be substituted with values related to the Automation's run.

This is a reference of the available patterns to use for substitution.

If you are creating an automation to Copy or Move files, the destination path determines where files will be copied, moved, or created. It has the capability to include formatting parameters like below, which can dynamically determine the destination at runtime.

When a destination path starts with ./ or ../, it is treated as a relative path. In all other cases, it is interpreted as an absolute path.

When a destination path ends with a /, it is recognized as a folder name, and the original filename is retained. On the other hand, if the destination path does not end with a /, the destination field serves as a replacement for the filename.

These apply only if the Automation trigger is a File Action, and refer to the filename of the triggering File Action:

  • %tp - entire path of triggering File
  • %tf - filename of triggering File (without folder name)
  • %td - folder name of triggering File (without file name)

If the Automation trigger is an Inbound Webhook, any GET or POST parameters that are sent to that Webhook can be used by name. Parameters are limited to 190 characters in length each and 550 characters in length total.

%u-[GET or POST Param name] - will be replaced by the value sent in that GET or POST parameter to the Inbound webhook. For example, if the inbound webhook received parameter username, replacement pattern %u-username could be used.

These apply based on the source path of the Automation. Remember that source paths can include wildcard characters, so this is how you would convert those wildcards in the source into something meaningful in the destination.

  • %p1 - right-most folder component of matching source path
  • %p2 - second right-most folder component of matching source path
  • %p3 - third right-most folder component of matching source path

These are always available and use the time associated with the run time of the automation. These values are similar to the values used by the strftime function in most standard code libraries.

  • %a - abbreviated weekday name (eg Mon)
  • %A - full weekday name (eg. Monday)
  • %b - abbreviated month name (eg. Jan)
  • %B - full month name (eg. January)
  • %C - century number (the year divided by 100, range 00 to 99)
  • %d - day of the month (01 to 31)
  • %e - day of the month (1 to 31)
  • %H - hour, using a 24-hour clock (00 to 23)
  • %I - hour, using a 12-hour clock (01 to 12)
  • %j - day of the year (001 to 366)
  • %m - month (01 to 12)
  • %M - minute (00 to 59)
  • %p - either am or pm according to the given time value
  • %r - time in am and pm notation
  • %R - time in 24 hour notation
  • %S - second (00 to 59)
  • %T - current time, equal to %H:%M:%S
  • %u - weekday as a number (1 to 7), Monday is represented as 1.
  • %U - week number of the current year, starting with the first Sunday as the first day of the first week
  • %V - The ISO 8601 week number of the current year (01 to 53), where week 1 is the first week that has at least 4 days in the current year, and with Monday as the first day of the week
  • %W - week number of the current year, starting with the first Monday as the first day of the first week
  • %w - weekday as a number (0 to 6), Sunday is represented as 0.
  • %y - two-digit year without a century (range 00 to 99)
  • %Y - four-digit year including the century
  • %Z - time zone or name or abbreviation
  • %% - a literal % character

Find and Replace Text in File Names

For automation types like Copy or Move files, you can search for specific text in the destination file name and replace it with your preferred text. For instance, you can configure the Move or Copy files automation to find all destination file names containing the text Reviewed and replace it with the text Final; then, any destination file name containing the text Reviewed (e.g., Invoice-Reviewed.pdf) will be renamed to Invoice-Final.pdf. Keep in mind that the search is case-sensitive, and wildcards are not supported.

Get Instant Access to Files.com

The button below will take you to our Free Trial signup page. Click on the white "Start My Free Trial" button, then fill out the short form on the next page. Your account will be activated instantly. You can dive in and start yourself or let us help. The choice is yours.

Start My Free Trial

©2024 Files.com. All right reserved

FILES.COM

  • Start My Free Trial
  • Pricing
  • Docs
  • API and SDKs
  • Contact

CONTACT & SUPPORT

support@files.com

(800) 286-8372

Monday–Friday

9am–8pm Eastern