Hi,
after parameter contains a date in epoc format and is automatically added to the query. This is the date of the last message that was processed and to avoid being triggered more than once. Btw, by searching unread messages, you can return your messages as often as you want. This will facilitate the development of your Google Email Search.
@ritchierich
I seem to have found a situation I cannot figure out. I am trying to make a GCalSearch trigger that will toggle a switch ONLY at the start of an event, and do nothing at the end of the event. Currently, it will toggle the desired switch to OFF at the beginning of the event as desired, but then automatically switches it back ON when the event is ended on the calendar. I want a trigger that ONLY triggers the switch at the beginning of the event, and ignores the end time of the event. How can I make this happen?
I am actually not using a child switch, but a external virtual switch. (I named it as if it were a child switch to maintain consistency with the rest of my GCalSearch switches)
I thought based on the description provided above this option, that I could do a single time toggle by controlling an external switch and choosing the desired switch state, but it seems that even this method also reverts at the end of the event and turns the switch back to 'On'.
Since this functionality hasn't been requested yet, I guess I'd like to request this option if it isn't too difficult to implement. I would happily send a donation to your PayPal if you'd like to link it (I don't see a link in the parent app page or at the top of this thread for donations)
(Also, I just noticed that there seems to be no toggle to enable Description Text in logs on any new GCalSearch triggers I create, but the toggle still exists on older ones. ??)
Just spent a little time and got this implemented. The Additional Actions \ Control Switches from calendar event details has this functionality and I was able to copy some code to make the change quickly.
I'm looking at possible adding in some calendar event parsing so I can get a little more granular with my notifications. Using a hub variable in the notice. I don't know if the following can be done or not though. I understand that the parser will take everything after the Text Prefix, but could it be set to take anything before the text? Or maybe even anything/everything except for the text?
For example, I have everyone trained to enter an event on a family calendar as "Person1 visit" or "person2 visit". I use the gCal search to monitor for "visit" and can then automate things based on a visitor coming. But being able to extract out who the visitor will be, Person1, Person2, etc., would be fantastic. And also not require me to retrain everyone to change the format of the event to "visit person1" or "visit person2".
OH! The "description" of the event and not the title of the event? If so, I misread that. Nobody uses the description of the calendar event. They only put their name followed by visit in the title of the calendar entry.
My bad I haven't touched that code in a long while and forgot you can choose different attributes within the calendar event including the title. Sorry for the confusion.
Looking at the code it is a quick change to get this working for you. In the current version I have a check to ensure that the parsed attribute "Starts with" the value of the Text Prefix and that can be changed to do a contains like search instead.
Would you mind testing this to ensure this will work for you? I uploaded a Beta version to Github
Navigate to Developer Tools \ Apps Code
Open the GCal Search Trigger app
Click the Import button at the top of the screen and enter the following URL:
Thanks for the amazing turn around time. Got it imported and noticed a few things.
It is case sensitive. If my calendar entry contains "visit" but the parsing text is "Visit", the variable doesn't get updated.
When the switch turns off, it didn't reset the variable to what was defined. Now granted I didn't actually wait for the switch to turn off, I deleted the event and polled the switch, so maybe that has something to do with it?
When I set an event based on a time range, and then I poll the calendar, nothing happens. Pasting the debug logs below if that helps. IIRC, a future event would populate the Current States but the switch wouldn't turn on until it's time. Even setting the event to start 20 minutes ago and poll, nothing would happen.
3a. Setting the event to an All Day worked to set the variable. The unset/reset didn't, as noted above.
Just to confirm you have case sensitive matching at the top disabled? Unfortunately Groovy is case sensitive so I will need to figure out how best to handle this in variable parsing too as this hasn't come up before and to be honest this isn't a feature I utilize in my own setup.
Will have to test this. Likely because you deleted the event before the scheduled end job could run and clear out the value.
Not sure I understand this. Depending on your settings above Additional Actions the event should be found by the app and scheduled things to occur based on the event time settings unless you turn off the delay setting.
This is odd because this is how I frequently test this app. Unless of course the event ended before the current time because events that span the current time will trigger the additional actions within a few seconds of it finding an event at the time of the poll/refresh.
I'll test again tomorrow. The hub I was on only has 1 gCal search trigger, and it has criteria to offset the start and stops. (I forgot about them.) This could be part of my issue too.
Regarding Groovy's case sensitivity, a work around, at least for me, could be two parsers. One using Visit and a second using visit.
Parsing the text is now case insensitive. The case insensitive option at the top is not leveraged when using Google search matching so decided to make it case insensitive by default.
I tested this and it does work at the end of the calendar event. If you want to blank it out, please make sure you put in a space in the Value to Set field because blank won't do anything.
@salieri making you aware of changes to the Additional Actions text parsing since I know you leverage it for Airbnb emails. Want to make sure there are no impacts to your use of this app.