Push button automation based on dates matching

I created a button in a table which sends a message to Slack when I click on it.

I want to do a time based automation based on Today’s date. Each row has a due date and I want to push that button when Due date = Today and then Due date = Today + 14 days etc. But for some reason SwitchIf is not working…

Here is where I am now:

RunActions(switchif(
[Table1].[Due date]=Today(),[Table1].Button1,
[Table1].[Due date]=Today()+Days(14),[Table1].Button1,
[Table1].[Due date]=Today()+Days(7),[Table1].Button1,
[Table1].[Due date]=Today()+Days(1),[Table1].Button1
[Table1].[Due date]<Today(),[Table1].Button1))

For me it seems like somehow the program cannot match the “DueDate” and the Today()+Days(X) for some reason.

Any suggestions?

hi @Egyesek_Youth_Association , you can have a look here for some inspiration

you need a filter, even if your brain tells you ‘if this happens, than that’ :wink:
I wrote about this phenomenon here:

1 Like

Ohh this looks like since fiction. But I don’t really get how is it connected to my challenge? I do not have duration. I have exact dates and I want to compare them to Today’s date and send message if it will be due, 14 days later, 7 days later, 1 day later and so on.

Or maybe I did not catch the meaning of your article right?

@Egyesek_Youth_Association , it can all feel rather overwhelming, however a bit down in that tread you find my contribution that deals with the 9 month question. I used a check box in this context to flag it it is time to set some action (delete in the example, but it can be any action). You can do something like that. Have a look, it is not that difficult.

@Christiaan_Huizer Ahhhhhhh. I think I understand what is the problem in my thinking!

Since this is a Time-based automation, I can’t really refer to “thisrow” as there is no action which would actually point to what is “thisrow” and in this way I can’t match Today() to thisrow.DueDate. So indeed, I will need some sort of .filter. So I should actually .Filter(Today()) or .Filter(Today()+Days(14)) but then how can I refer to only those Buttons in which are in the rows matching the Filter criteria? Since thisrow will still not work after .Filter.

don’t worry @Egyesek_Youth_Association , I made and make many mistakes. Getting this straighten out assumes a bit of back ground information.

I suggest these steps:

  • create an automation that pushes the button in the table every day
  • set this button to do the job (like sending email)
  • disable the button if a certain criteria is not met, so only on certain days the button will work.

There are other ways as well, paths I would follow in my docs, but this might be a good way to get the doc up and running

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.