I am trying to fetch all events from my google calendar that have either TERM_A or TERM_B in its event title. In other words, I am trying to use OR logic in my search query of getEvents()
function for CalendarApp
.
MWE:
function mwe(){
var mycal = "my@emailaddress.com";
var cal = CalendarApp.getCalendarById(mycal);
var events = cal.getEvents(new Date("June 26, 2018 00:00:00 CST"), new
Date("July 18, 2020 23:59:59 CST"), {search: SEARCH-FOR-TERM_A-OR-TERM_B});
Logger.log(events);
}
)
I have tried the following in place of SEARCH-FOR-TERM_A-OR-TERM_B:
- "TERM_A" | "TERM_B"
- "TERM_A | TERM_B"
- "TERM_A TERM_B"
- "'TERM_A' | 'TERM_B'"
and many such variants with zero success.
Related questions asked:
Any help would be highly appreciated.
or
instead of|
? – TheAddonDepot Nov 26 '18 at 18:27OR
andor
both. TERM_A returns one entry. TERM_B returns one entry. TERM_A or TERM_B returns empty output. – Urvah Shabbir Nov 26 '18 at 18:36+
? – TheMaster Nov 26 '18 at 20:52and
,AND
,+
. The+
is basically for a combination of words. It returns events where title has BOTH words. – Urvah Shabbir Nov 27 '18 at 3:48