cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
erica_tefft
Regular Visitor

Formatting Google Calendar Start/End Times

 

Hi, I'm working on creating my first flow as an integration between Esri's Survey123 and Google Calendar. The basic premise is, someone submits a survey, and fields within that response are used to generate a calendar event.

 

Because of the original time format (incoming as UNIX) , I'm converting both an input start/end time using addSeconds, with the conversion result for both being UTC-05:00. I then want to feed the result of these conversions into the Google Calendar "Start time" and "End time" fields. Here is my addSeconds conversion. Below is a screen capture of my flow.

 

addseconds('1970-1-1', Div(triggerBody()?['feature']?['attributes']?['Decon_Appt_Start'],1000) , 'yyyy-MM-ddTHH:mm:ss')

When I test my flow, the Google Calendar portion fails with the error: 

{
  "error": {
    "errors": [
      {
        "domain": "global",
        "reason": "invalid",
        "message": "Invalid value for: Invalid format: \"8/15/2018 9:30 AM\" is malformed at \"/15/2018 9:30 AM\""
      }
    ],
    "code": 400,
    "message": "Invalid value for: Invalid format: \"8/15/2018 9:30 AM\" is malformed at \"/15/2018 9:30 AM\""
  }
}

 

I've been messing around with the Format String option in "Convert Time Zone", but it seems like regardless of what I select, I still get a similar error to the one above. Looking now, my screen capture has a different Format String option set than what trigger that particular error above. Either way, it shouldn't matter as they all fail with the same problem.

 

Any suggestions on how to get Google Calendar to consume my date/times would be appreciated.

FlowCapture.PNG

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @v-yamao-msft,

 

Thank you for getting back to me! I was actually able to figure out a solution to my problem, however I don't know if it is "the proper" way to have corrected my issue - but it works!

 

I started looking more closely at my Format String, and changed the syntax here to 'yyyy-MM-ddTHH:mm:ss.fffZ' after stumbling across a posting on GitHub. This solution seemed to work, however I also needed to change my Source and Destination Time Zones to both be equal to UTC-05:00 (which didn't quite make sense to me), but this allowed the calendar appointment to show up properly.

 

Erica

View solution in original post

3 REPLIES 3
v-yamao-msft
Community Support
Community Support

Hi @erica_tefft,

 

I have made a test on my side trying to convert the unix timestamp to UTC format.

 

The code I am using is:

formatDateTime(addDays('1970-01-01T00:00:00Z',div(triggerBody()['number'],86400)),'yyyy-MM-ddTHH:mm:ss')

The flow is configured as:

1.PNG

 

Please take this doc for a reference:

https://www.epochconverter.com/ 

 

 

Best regards,

Mabel Mao

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @v-yamao-msft,

 

Thank you for getting back to me! I was actually able to figure out a solution to my problem, however I don't know if it is "the proper" way to have corrected my issue - but it works!

 

I started looking more closely at my Format String, and changed the syntax here to 'yyyy-MM-ddTHH:mm:ss.fffZ' after stumbling across a posting on GitHub. This solution seemed to work, however I also needed to change my Source and Destination Time Zones to both be equal to UTC-05:00 (which didn't quite make sense to me), but this allowed the calendar appointment to show up properly.

 

Erica

Hi @erica_tefft,

 

I am glad to hear that it is working for you now. And thanks for your sharing.

 

Best regards,

Mabel Mao

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

Carousel_PP_768x460_Wave2 (1).png

2022 Release Wave 2 Plan

Power Platform release plan for the 2022 release wave 2 describes all new features releasing from October 2022 through March 2023.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (3,161)