How to Import a feed with a datetime stamp
Sometimes clients will drop files that contain a datetime stamp appended to the end, giving us something like clientfeedname_2019-06-01.txt
that needs to be imported as a datasource. Since the date changes based on when the file is dropped, we provide a way to pull in this dynamic value.
Instructions
Determine the datetime format that the file is using. The standard for Alli Product Feeds is Y-m-d\T00:00:00O
. There are several formatting options, but here are some of the most common you may encounter:
Format | Result |
---|---|
| 2019-06-01 |
| 2019-06-01 |
| 20190601 |
| 01/06/2019 |
Once you’ve nailed down the format, we can build the datasource with a filename placeholder that lets Alli know it will be checking for a DateTime within the file.
In the datasource configuration, you will set the filename to match the prefix of the file with the templated placeholder as {_current_date|date(“format from above”)}
It should look something like this:
Save and run a test import to confirm the format matches the file!