[SalesForce] File naming convention for automated data import Exact Target

Within SFMC we have set up an listening trigger automation in automation studio which runs whenever a new file is put on the ftp site.

However often it fails on the import as the filename which contains Hours and Minutes might be slightly off.

For example the file is uploaded at 1/1/2016 at 10:53 pm but has the name myfile_010120161050.txt. As a result when the trigger runs it calls the import but the times do not match so it says 'Error – file does not exist'.

How can we get this to work without using a static file name?

Is there a wildcard we can use like so instead of:

myfile_%%day%%%%month%%%%year%%%%hour%%%%minute%%%%.txt

We can just use:

myfile_%%.txt

Thanks
Bryan

Best Answer

Yes you can do "Contains" "Begins with" or "Ends with" for the naming convention.

ref (https://help.exacttarget.com/en/documentation/automation_studio/triggered_automations/)

When setting up a filename pattern, users select an operator to dictate how Automation Studio should parse the filename. The available operators are Contains, Begins With, and Ends With.

Use Contains when Automation Studio should find files whose filename includes the filename pattern at any point (prior to the file extension, which is not parsed).

Example:

Filename pattern = AUG14

Files named AUG14import.csv, Update_ AUG14.txt, and NewContactsAUG14profileupdates.zip will kick off this automation. Files named AUG 14data.csv, CustomerFiles.AUG14, and DailyJob-Aug-14.txt will not trigger this automation.

Use Begins With when Automation Studio should find files whose filename starts with the filename pattern.

Example:

Filename pattern = AUG14

Files named AUG14import.csv, aug14files.zip, and Aug14098786.txt will trigger this automation. Files named 1AUG14data.csv, 120814_ AUG14.zip, and _ AUG14.txt will not trigger this automation.

Use Ends with when Automation Studio should find files whose filename ends with the filename pattern.

Example:

Filename pattern = AUG14

Files named ImportAUG14.csv, aug14_listpull_aug14.zip, and usersAug14.txt will trigger this automation. Files named datapullAUG14_01.csv, listinfoAUG14.run.txt, and Aug14_.zip will not trigger this automation.

For the import activity, there are other personalization strings that can be used. https://help.exacttarget.com/en/documentation/automation_studio/triggered_automations/

Try using %%FILENAME_FROM_TRIGGER%% inside the import activity.

Substitution Strings

Place the following substitution strings in the "File Naming Pattern" field to call a file transfer activity or import activity. In other words, use these strings to import, upload, or download a file from a transfer location.

%%FILENAME_FROM_TRIGGER%%

This returns the name of the file placed in the FTP folder.

Prefixes, suffixes, and/or file extensions are not allowed.  File extensions are not read by the automation engine, so any characters that follow the final dot [.] in a filename are automatically excised

Related Topic