AnsweredAssumed Answered

Google Calendar File attachments for the event

Question asked by dmagill on Feb 16, 2018
Latest reply on Feb 16, 2018 by dmagill

I am able to successfully create calendar events on Google Calendar thanks to the great demo file from DB Services FileMaker Google Calendar Integration | DB Services . I have added an element to also add the location information by following the example. The last piece to my puzzle is attaching a pdf to the event. I have very little understanding of json and I am particularly stuck on how to format the url. I have been attempting to use a url pointing to a file through Google Drive File Stream but it is not working. I have been trying to follow the requirements at@ Events  |  Calendar API  |  Google Developers . One example that I am trying is file:///G:/Team Drives/myFile.pdf but I honestly am not sure if I am even barking up the right tree with this. Any help is greatly appreciated.

 

//calculation originated from https://dbservices.com/articles/filemaker-google-calendar-integration/ demo file

//some modifications to the original calculation below including "location" and "attachments"

 

Let ( [

vStartDateType = If ( not IsEmpty ( $startTime ) ; "dateTime" ; "date" ) ;

vStartDate = If ( not IsEmpty ( $startTime ) ; $startDate & "T" & $startTime & timeOffsetUTC ; $startDate ) ;

vEndDateType = If ( not IsEmpty ( $endTime ) ; "dateTime" ; "date" ) ;

vEndDate = If ( not IsEmpty ( $endTime ) ; $endDate & "T" & $endTime & timeOffsetUTC ; $endDate ) ;

vColor = $color ;

       vAttach = $filepaths

];

JSONSetElement ( "{}" ;

[ "start" ; JSONSetElement ( "{}" ; vStartDateType ; vStartDate ; JSONString ) ; JSONObject ] ;

[ "end" ; JSONSetElement ( "{}" ; vEndDateType ; vEndDate ; JSONString ) ; JSONObject ] ;

[ "summary" ; $calendarTitle ; JSONString ] ;

[ "location" ; $locationAddress ; JSONString ] ;

[ "colorId" ; vColor ; JSONString ] ;

[ "attachments" ; JSONSetElement ( "{}" ; "fileUrl" ; vAttach ; JSONString ) ; JSONObject ]

)

)

Outcomes