cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
KotyJ
Level: Powered On

Issue with Google Date Strings

Hello Flow Community,

 

I am trying to write a flow that takes all of the events from several Google Calendars (across multiple accounts) and adds them all to a single Google Calendar ("Calendar for EVERYTHING - Imported from Flow"). My university, which uses Google Suites, has a system where people will try to schedule appointments with me, but they can only see my busy events that are posted to my school account's personal calendar (the one I've named "Calendar for EVERYTHING - Imported from Flow"); they cannot see events on my calendars such as "Classes", "Koty Jackson - Personal Calendar" (My personal calendar from my own Google account), etc.

 

The flow I have so far does the following: (or at least, should in theory)

  • search my "Calendar for EVERYTHING" for events with "Created Via Flow" in the description and delete them
    • This is so I do not have 1000+ copies of the same event at the same time.
  • Go through each of my calendars, both on my school email and my personal email, and add all events between now and 120 days from now to my "Calendar for EVERYTHING".
    • Adding the original description + "Created Via Flow" to the description so that I can keep track of what events have been added to the calendar by Flow vs. by email invitations and only delete and recreate the ones created from Flow.

This works without fail in my "Classes" calendar because every event has a precise start and end time. However, some of the events in my personal calendar will be all day events. When bullet point 2 reaches these events, I get the following error:

{
  "error": {
    "errors": [
      {
        "domain""global",
        "reason""invalid",
        "message""Invalid value for: Invalid format: \"2018-10-05\" is too short"
      }
    ],
    "code"400,
    "message""Invalid value for: Invalid format: \"2018-10-05\" is too short"
  }
}

 

This is because Google returns the full day events in format YYYY-MM-DD, instead of the standard YYYY-MM-DDThh:mm:ss+........... format. This shorter format is not enough information for the "Create an Event" process to run, so it fails my flow and does not proceed to check further calendars.

 

What I would like to do is be able to put a condition where it skips the all-day events with the format YYYY-MM-DD and only adds events to my "Calendar for EVERYTHING" that have a definitive start and end time. If this is not possible, I would like to be able to format the YYYY-MM-DD into the standard YYYY-MM-DDThh:mm:ss+..... so that I can create an event that runs from 12:00 to 12:01 am (I don't need to worry about people actually scheduling me at those times, obviously). Is there any way to do a "String is of format ()" within a condition? How should I proceed?

 

Sorry if this explanation doesn't make much sense, so I've attached my flow. Thanks for any help you can provide!

 

Flow Issue pt 2.png

Flow Issue pt 1.png

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Issue with Google Date Strings

Hi @KotyJ,

 

If you want to put a condition where it skips the all-day events with the format YYYY-MM-DD and only adds events to your calendar that have a definitive start and end time, you could add the Condition as below:

 

Capture.PNG

 

The expression in the Condition as below:

@equals(length(items('Apply_to_each')?['start']), 10)

If you would like to be able to format the YYYY-MM-DD into the standard YYYY-MM-DDThh:mm:ss+..... , you could refer to screenshot below to create the flow:

Capture.PNG

 

The expression in the Start time field in the "Create an event" action as below:

formatDateTime(items('Apply_to_each')?['start'],'yyyy-MM-ddTHH:mm:ss+hh:mm')

The expression in the End time field in the "Create an event" action as below:

formatDateTime(items('Apply_to_each')?['end'],'yyyy-MM-ddTHH:mm:ss+hh:mm')

 

Please take a try on your side and let me know if your problem could be solved.

 

Best regards,

Alice

 

 

 

3 REPLIES 3
Community Support Team
Community Support Team

Re: Issue with Google Date Strings

Hi @KotyJ,

 

If you want to put a condition where it skips the all-day events with the format YYYY-MM-DD and only adds events to your calendar that have a definitive start and end time, you could add the Condition as below:

 

Capture.PNG

 

The expression in the Condition as below:

@equals(length(items('Apply_to_each')?['start']), 10)

If you would like to be able to format the YYYY-MM-DD into the standard YYYY-MM-DDThh:mm:ss+..... , you could refer to screenshot below to create the flow:

Capture.PNG

 

The expression in the Start time field in the "Create an event" action as below:

formatDateTime(items('Apply_to_each')?['start'],'yyyy-MM-ddTHH:mm:ss+hh:mm')

The expression in the End time field in the "Create an event" action as below:

formatDateTime(items('Apply_to_each')?['end'],'yyyy-MM-ddTHH:mm:ss+hh:mm')

 

Please take a try on your side and let me know if your problem could be solved.

 

Best regards,

Alice

 

 

 

Administrator
Administrator

Re: Issue with Google Date Strings

Hello, @KotyJ!

Thank you for posting on the Flow Community Forum! Have you had an opportunity to apply @v-yuazh-msft‘s recommendation to adapt your Flow? If yes, and you find that solution to be satisfactory, please go ahead and click “Accept as Solution” so that this thread will be marked for other users to easily identify!

Thank you for being an active member of the Flow Community!

-Gabriel
Flow Community Manager

-Gabriel
Microsoft Flow Community Manager
KotyJ
Level: Powered On

Re: Issue with Google Date Strings

Hi, thank you for the advice! This seems to have fixed the issue. It runs perfectly now.

Helpful resources

Announcements
firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 Release Wave 2 Plan

Power Platform 2019 Release Wave 2 Plan

Features releasing from October 2019 through March 2020

thirdimage

Flow Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Flow Community Video Gallery!

Top Kudoed Authors
Users Online
Currently online: 225 members 4,715 guests
Please welcome our newest community members: