Automate an email on a non-event

I’ve been asked to set up a weekly report that notifies someone that a task is overdue. For example, notify when the weekly inspection has NOT been completed by Friday morning, so it gets done by the end of the day. I’m trying to call up the most recent row and then check if it has a date within the past 5 days, and if NO, then send the email. This seems like it would work.

I have a table called WeeklyInspection, it has a column called Date, key column is called ID_weekly …

Condition for event Scheduled: Every week (yes/no):

MAXROW(“WeeklyInspection”, “Date”)<(Today()-5)

MAXROW(“WeeklyInspection”, “Date”)-NOW() >= 5

The error I get for both variants is
Arithmetic expression ‘(ANY(SELECT(WeeklyInspection[ID_weekly],AND(“Y”, ([Date] = MAX(SELECT(WeeklyInspection[Date],“Y”)))))) < (TODAY()-5))’ does not have valid input types

I’m not sure where it is going wrong, although I suspect it should be obvious and I haven’t had enough coffee to see it.

Hi @anythingichoose

You’re on the right track, but the issue is that MAXROW() returns a key value, not a date. Since you’re comparing it directly to a date (TODAY() - 5), AppSheet throws a type mismatch error.

We need to:

  1. Find the most recent date in the WeeklyInspection table.
  2. Check if that date is older than 5 days from today.

Fixed Expression

MAX(WeeklyInspection[Date]) < (TODAY() - 5)

1 Like

Thanks so much! The expression was accepted. I can’t tell if it worked yet because my app hasn’t been approved for deployment yet. But I will update when I have confirmation.

1 Like