Separating invoice dates from filenames for automation

:bullseye: What is your goal?

I have a scenario that searches for invoices I get and adds them to the google drive. They all are named “Invoice DD.MM.YYYY”. I wanted to add a module to look for the invoices with the date in the name that’s 14 days later than the present date.

:thinking: What is the problem & what have you tried?

First of all I want to get the invoices that are older than 14 days. (If it’d be possible I’d want the “Search files” module to look only for he invoices that are older than 14 days to save credits). Then I need for the scenario to determinate if the date in the filename is older than 14 days. If it is it’s going to delete the invoice. I don’t know how to make the scneario to determinate it. I suppose I need to separate the “Invoice” word and the date in the filename and then get the date as seperate variable. Even if I managed to get it done I still don’t know how to make the scenario check if the date’s older than 14 days. So there are 2 problems. Getting the date of the filename as separate variable and checking if the date’s older than 14 days. I’ll be very grateful for help. In the attachments I send the screenshot of my scneario maybe it’ll help a litte. Also It’d be great if it didn’t need to use AI but it’s not a must!

:camera_with_flash: Screenshots (scenario flow, module settings, errors)

Ok i can help you with this!

You are mixing email-triggered flow with file cleanup logic.

This is inefficient and confusing because:

  • You only need Google Drive - cleanup logic

  • Gmail modules are not needed for deleting old invoices

:light_bulb: Unless your goal is:

“Download invoices from email → store → later delete”

If not → REMOVE Gmail modules.

You said:

“I want Search Files to only return files older than 14 days”

This is NOT possible directly in most Make modules (Google Drive, Dropbox, etc.) because:

  • The module does NOT understand dates inside filenames

  • It only filters by:

    • Created date

    • Modified date

    • Name (text only, not parsed logic)

    So the correct architecture is:

  • Search files (broad)

  • Filter INSIDE Make (smart logic)

    This should help out expecting your feedback

Yes.

“Download invocies from email - store - later delete”

is exactly my goal. And I don’t understand what you mean by “cleanup logic. Could you explain further?

I undrestand. I just thought that if i took out for example: “01.01.2026” out of “Inovice 01.01.2026” filename make could understand it as a date that could work with. Anyways if it’s not possible could you tell me how to setup a filter that passes only dates older than 14 days?

Apologies for the late reply @Skeynor currently busy with a client job would hop on it right now.

What i meant by the clean up logic is:
A part of your scenario that periodically checks stored files and removes old ones

So instead of deleting immediately, you:

  1. Save invoices

  2. Wait (days pass)

  3. Run a scheduled scenario that:

    • Finds invoices

    • Checks their date

    • Deletes old ones

After adding the filter module set it up this way

parseDate(
replace(
replace(1.name; "Invoice "; “”);
“.pdf”;
“”
);
“DD.MM.YYYY”
) < addDays(now; -14)

Follow the details exactly without excluding any with that you would get the filter setup and ensure to give feedback after trying it out

1 Like