Best answer

How do I create a Google Calendar event with half duration of the original event?

  • 22 August 2023
  • 12 replies
  • 351 views

Userlevel 1

I can successfully make a new Google Calendar event based on the data of an existing Google calendar entry. However, I would like to make that new calendar event a variation of the existing calendar event. For instance, if it is a 1 hour meeting for the original event, I want to make the Zapier generated event to be 30 minutes (half of the duration). It appears that for a new calendar entry, I must give it the start time and the end time (rather than the start time plus the duration).

The new start time = the old end time plus half of the duration.

I would like to do something like Event Ends + Duration/2 but that doesn’t seem to work. Right now I am hard coding it with Event Ends + 45m but that doesn’t work for most use cases.

icon

Best answer by Troy Tessalone 23 August 2023, 03:16

View original

This post has been closed for comments. Please create a new post if you need help or have a question about this topic.

12 replies

Userlevel 7
Badge +14

Hi @soshaughnessey 

Good question.

You may need to add a Formatter > Numbers > Perform Math Operation step to determine the new Duration.

Try using Date/Time modifiers:

 

 

Userlevel 1

Troy -

Thank you for that suggestion. I did try that but I ended up with an error. I don’t see a way to see the value of each step (maybe that is because I am new to building Zaps) so I couldn’t see why that calculation didn’t work. That is why I resorted to hard coding the time.

 

Sean

Userlevel 1

To be a bit more clear, I was able to use the Formatter to generate 30.0 from the duration (if the meeting was 30 minutes long) but I couldn’t then use that result appended with a “m” for minutes to extend the amount of time.

Userlevel 7
Badge +14

@soshaughnessey 

We would need to see detailed screenshots with how your Zap steps are configured to have enough context.

Userlevel 1

I think this is the part that you would need:

 

Userlevel 7
Badge +14

@soshaughnessey 

Make sure to check the field description for the Start/End Date & Time as those need to be in a specific format.

You can use a Formatter > Date & Time > Format step to adjust.

Userlevel 1

Sorry if I haven’t given enough information to allow you to help me.

Here is my Zap. As you can see the first two steps are running correctly


Here is the settings for Formatter.


As you can see, the Formatter returns 60.0 
 



When I put the Formatter output into the End time for the meeting, I get an error. If I was to just type in +60M, the Action works perfectly.

 

I appreciate any help or assistance. 

Is it because I need to somehow concatenate the Output of Step 2 (which is 60.0) with the “m” to denote minutes before I put it into the End Date & Time? If so, I am not sure how to do that.

 

Sean

Userlevel 7
Badge +14

@soshaughnessey 

Help articles for using GCal in Zaps: https://zapier.com/apps/google-calendar/help

 

Is the event created on the wrong date, specifically with the month and day switched?

Regardless of the settings in your Google Calendar, data sent through their API (as Zapier does) must be in MM/DD/YYYY format. So, if you try to send an event for April 7, 2021 as 07/04/2021, Google Calendar will interpret that as July 4, 2021. The dates need to be in MM/DD/YYYY format to ensure Google Calendar adds the event to the correct date(s). If your trigger is sending the data in DD/MM format, you can use a Formatter step to reformat the date.

Userlevel 1

That isn’t the problem. If I replace the “ +[2. Output 60.0]m” with “ +60M” the action works perfectly and as expected. Also, I am getting an error code. According to the error code that I sent you screenshot for is:

I don’t get this error if I put a defined amount i.e. “ +60M”

It has to be something with the Output of the Formatter step not being what Zapier is expecting. My gut is that I need to change the [2. Output 60.0] to text but I am unsure how to do that in Zapier.

Userlevel 7
Badge +14

@soshaughnessey 

Try converting the value to an integer, meaning no decimals.

 

Userlevel 1

It finally worked. The trick was to turn it into text and use Split in Formatter to only do the whole numbers by splitting at the decimal and taking the integer portion.

Thank you for all of your help.

Userlevel 7
Badge +11

That’s awesome! 🎉 Thanks so much for hopping back here to confirm how you solved this, @soshaughnessey. And big thanks to Troy for helping out here! 

If anything else comes up, do let us know - the Community is always here and eager to help! 🙂