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

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
erica_tefft
Level: Powered On

Re: Formatting Google Calendar Start/End Times

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
Community Support Team
Community Support Team

Re: Formatting Google Calendar Start/End Times

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.
erica_tefft
Level: Powered On

Re: Formatting Google Calendar Start/End Times

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

Community Support Team
Community Support Team

Re: Formatting Google Calendar Start/End Times

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
firstImage

Microsoft Business Applications Virtual Launch Event

Watch the event on demand 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: 444 members 5,659 guests
Please welcome our newest community members: