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)
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!
Solved! Go to Solution.
Hi @Anonymous,
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:
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:
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
Hi @Anonymous,
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:
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:
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
Hello, @Anonymous!
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
Hi, thank you for the advice! This seems to have fixed the issue. It runs perfectly now.
User | Count |
---|---|
92 | |
45 | |
21 | |
18 | |
16 |
User | Count |
---|---|
136 | |
49 | |
42 | |
36 | |
28 |