Set Variable value formula for expiration date

:bullseye: What is your goal?

I want to know the formula I for tracking expiration date.

:thinking: What is the problem?

my current formula cannot produce the count of expired items.

:test_tube: What have you tried so far?

I tried

{{map(19.array; 13; if(parseDate(19.array.13; “MM/DD/YYYY”) <= formatDate(now; “MM/DD/YYYY”); “1”; “0”))}}

{{length(map(19.array; if(19.array.13 <= formatDate(now; “MM/DD/YYYY”); 1; 0); 13; 0))}}

:camera_with_flash: Screenshots: scenario setup, module configuration, errors

Welcome to the Make community!

Please provide the Output bundle of the Array Aggregator (module [19]) from the Scenario History, or by re-running the scenario.

Expand Instructions ◀

Click on the white speech bubbles on the top-right of each module and select “Download output (or input) bundles”.

A. Upload a Text File

Save each bundle contents in a plain text editor as a moduleNumber-output.txt file. Open the file to check if it has not added additional formatting or encoded the plain text.

  • You can upload files and images to this forum by clicking on the upload button:

    Uploading an attachment here will look like this:
    module1-input.txt (1.2 KB), module1-output.txt (3.4 KB)

B. Insert a Formatted Code Block

If you are unable to upload files on this forum, alternatively you can paste the bundles AND format them correctly with the “Preformatted Text” (code) button in the rich-text editor. Otherwise the forum software will change the content, making them invalid!

:warning: Formatting IS Important! :warning:

Here are some ways to provide text content in a way that it won’t be modified by the forum.

  • Method 1: Type code fence manually
    Manually type three backticks ``` in a separate line before and after the content, like this,

    ```
    text goes here
    ```
    
  • Method 2: Highlight the pasted content, then click the preformatted text/code button

  • Method 3: Upload your file elsewhere and share the public link
    This method is only advised for large files exceeding the forum upload limit.

Providing the Output bundle will allow others to replicate what is going on, especially if there are complex data structures (like nested arrays and collections) and data from external services. This helps us with answering your question with valid examples, like mapping raw variable names (instead of the label/display name).


This will allow others to better assist you. Thanks!

@samliew
P.S.: investing some effort into the tutorials in the Make Academy will save you lots of time and frustration using Make!

if([array aggregator date] >= addDays(now ; - [amount of days]) ; Expired ; Not Expired)

Use format date on aggregator & now date times.