Adding Google Calendar to Your Jamstack - with Pipedream -- help!

I am trying to follow this guide:

But I can’t see the action “Google Calendar - Get All Future Events” listed in Pipedream.

Am I missing something or is this action no longer available?

Hi @losource

First off, welcome to the Pipedream community. Happy to have you!

I believe that the Google Calendar API may have released a major upgrade since then.

From what I can see in the Google Calendar API docs, you can pass a timeMin parameter to query your calendars events after a specific date time:

You may be able to filter Google Calendar events that way.

1 Like

Thanks for the reply! I will try to get this working…

I need to see an example of how to build a query with node, of course the docs only have JAVA, Python and PHP.

Have you tried using the Pipedream Google Calendar - Use any Google Calendar API action in your workflow? That should generate either Python or Node.js scaffolding code.

Then you can just modify the URL and the params in that scaffolding step to match the Google Calendar API documentation.

I’ll take a look. It may be that Airtable is less complex and more suitable for my needs!

I got it working. Just in case anyone else lands here looking for the updated code:

import { axios } from "@pipedream/platform"
const date = new Date();
var currentdate  = date.toISOString();

export default defineComponent({
  props: {
    google_calendar: {
      type: "app",
      app: "google_calendar",
    }
  },
  async run({steps, $}) {
    return await axios($, {
      
      url: `https://www.googleapis.com/calendar/v3/calendars/primary/events`,
      params: {
        maxResults: 10,
        timeMin: currentdate,
        singleEvents: true,
        orderBy: 'startTime'
      },
      
      headers: {
        Authorization: `Bearer ${this.google_calendar.$auth.oauth_access_token}`,
        
      },
    })
  },
})
1 Like

Great job @losource :raised_hands:

Thanks for sharing!

Soon you’ll be able to publish this action to your own Pipedream account right from the workflow builder.

But as for now, you can convert this into a reusable action using the Pipedream CLI: Overview

Then you can reuse it in other workflows via the My Actions in a new step.

1 Like

I’m impressed with Pipedream, think I’ll be using it from now on, thanks…

1 Like