Import Files by Dynamic URL Pattern

In this tutorial, we will learn how to import a file from a URL that changes daily.

Some suppliers provide product feeds where the file name contains the current date. Example:

  • Today (30 August 2022): https://example.com/products-30-08-2022.csv
  • Tomorrow (31 August 2022): https://example.com/products-31-08-2022.csv

Instead of manually updating the file URL every day, you can use patterns in the file name. This way, the system will automatically replace the date with the current day.

Step 1: Use a Pattern in the File URL

Example pattern:

https://example.com/products-{d-m-Y}.csv

Here:

  • d = day (with leading zero, e.g., 01–31)
  • m = month (with leading zero, e.g., 01–12)
  • Y = year (four digits, e.g., 2022)

So on 30 August 2022, the system will automatically generate: https://example.com/products-30-08-2022.csv

Important: The app uses GMT timezone when calculating the date.

Step 2: Configure in Products Sync Master

  1. Open the import settings in Products Sync Master.
  2. In the File Source field, paste the URL with your pattern. Example: https://example.com/products-{d-m-Y}.csv
  3. Save your settings. The app will automatically replace the placeholders with the correct date at runtime.

Step 3: Available Pattern Characters

You can use many date and time placeholders. Here are some useful examples:

  • d – Day of the month (01–31)
  • m – Month (01–12)
  • Y – Year (e.g., 2022)
  • H – Hour (00–23)
  • i – Minutes (00–59)
  • W – ISO week number

👉 For the full list of supported placeholders, see the table below:

(insert your table of all format characters here)

Step 4: Examples

  • https://example.com/products-{Y}-{m}-{d}.csv2022-08-30
  • https://example.com/feed-{Y}{m}{d}.xml20220830
  • https://example.com/products-week-{W}.csvweek-35
  • https://example.com/pricelist-{Y}-{m}-{d}-{H}.csv2022-08-30-15 (file for 3 PM)

Why Use Patterns?

  • Save time – no need to update the file URL every day.
  • Avoid mistakes when typing or pasting file links.
  • Automate imports from suppliers that refresh files daily, weekly, or monthly.