Services Plugins FAQs

Google Calendar - filtering and page tokens

Hi all,

I’m trying to write a component of a Bubble app which connects to a google calendar, retrieves a list of appointments and then synchronizes with my DB.

I can connect and retrieve the calendar events fine but since the calendar is over 4 years old, there are thousands of items in it and while using this plugin, I’m struggling to filter it to a set date period. It retrieves events 250 at a time starting from the first one back in 2014.

I’d like to be able to:

  • set it to only retrieve items from the future, or
  • set it to retrieve items from a set date period, and
  • if the number of items is more than 250, create a link to cycle to the next page

I’m guessing this is possible, I’m just missing something. Please help @levon :slight_smile:

Hey Scott,
i’ve just pushed an update to the plugin with added filtering options when you retrieve calendar events.
Here the optional parameters that you would be able to use:

orderBy
pageToken
q
timeMax
timeMin
updatedMin
maxResults

you can find the explanation about these parameters here:

Hope this helps

Levon Terteryan
Founder @ Zeroqode & Bubblewits

let’s stay in touch on twitter!

zeroqode-for-web-160x120

Bubble Templates
Bubble Plugins
Bubble Courses
Convert Web to iOS & Android
No-code Development Services

Service with a smile, much appreciated.

I shall make good with these options and let you know my success.

1 Like

It’s working with those new parameters, I’m able to cycle through pages, give it a date start, etc and it’s returning the info I need.

One thing which tripped me up and I should have really checked first was the date format for the date/time parameters needs to be in an extended ISO format.

Now, onto a bug…It’s something I can filter out with the :filtered parameter built into Bubble so it’s not that much of an issue but I’m wondering why, when I’ve given it a date to start from that it’s pulling in occasional dates that are before it…

I’ve attached a screenshot to show what I mean.

The first row of the screenshot is the number of results it’s returned, the datestamp below it is the variable used in the timeMin parameter and then you can see the first 3 results are from January before going into the correct date range below it.

and here’s a second screenshot:

2018-04-10_10-14-40

This shows the parameters of the query.

Scott,
the minTime filters by the event’s endtime maybe those first 3 events have an endtime which is greater than the filter parameter?
Else, I have no idea why this could happen unfortunately and it’'s probably something on the google side.

Levon Terteryan
Founder @ Zeroqode & Bubblewits

let’s stay in touch on twitter!

zeroqode-for-web-160x120

Bubble Templates
Bubble Plugins
Bubble Courses
Convert Web to iOS & Android
No-code Development Services

No, the maximum any one of those events has is 24 hours.

It’s more than likely a bug in how it’s delivered to us, as you say. It’s not a major problem, I can mitigate it, I was just curious as to why it might crop up.

1 Like