0

I created an import activity to import a csv with today's date file on our FTP using date variables. Currently, three csv files with different date ("test_20200313.csv", "test_20200312.csv" and "test_20200314.csv") on the FTP and the file naming pattern determines "test_20200312.csv", not "test_20200314.csv".

What should i do for the file naming pattern to determine the csv of today's date when multiple csv with different dates exist on FTP?

1 Answer 1

1

I'm assuming 'our FTP' is your Enhanced FTP provided with your Salesforce Marketing Cloud account?

If so, you can do what I think you're trying to achieve in a number of ways. Firstly, if you're just wanting to manually run an Import Activity or you're running it in a scheduled automation, you can use personalization strings to substitute the date variables in your file name. For example, you can pick up today's file with a file name in your import activity accordingly:

test_%%Year%%%%Month%%%%Day%%.csv

You can also restrict files considered by altering the system buffer in the advanced settings of the Import Activity. This allows you to only consider files created within a given time period, irrespective of file name.

Depending on your use case, you should also consider using a File Drop Automation. These are started immediately on arrival a new file and more often fit the purpose of processing inbound files. You can pass the name of the newly arrived file into your Import Activity using Substitution Strings. For example, the following used for the file name in your Import Activity would automatically use the name of the newly arrived file:

%%FILENAME_FROM_TRIGGER%%
3
  • What directory is your file in, what's the file name and what timezone are your in?
    – Macca
    Commented Mar 15, 2020 at 4:42
  • Thank you for your comment, Macca. > I'm assuming 'our FTP' is your Enhanced FTP provided with your Salesforce Marketing Cloud account? Yes, that's right. Please excuse my lack of explanation. I had used personalization strings to substitute the date variables in my file name. e.g) test_%%Year%%%%Month%%%%Day%%.csv But somehow "Explore file name" shows “ test_20200315.csv” while “File naming pattern sample” shows “test_20200312.csv”. My file is in import directory our account time zone is Japan(Tokyo, Osaka).
    – 0425_test
    Commented Mar 15, 2020 at 4:53
  • SFMC Servers run Central Standard Time (UTC-6). At the time you looked, 15th March hadn't started, yet, so test_20200315.csv wouldn't be picked up as it was still 14th March. You'll probably find using a file drop automation easier to work with as there are pretty limited situations I'd use the date variable in conjunction with a scheduled automation, these days.
    – Macca
    Commented Mar 15, 2020 at 5:10

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .