Answer how to attach a pdf to a google calendar event from the FileMaker Script step detailed. R1
$30-250 CAD
Completed
Posted about 6 years ago
$30-250 CAD
Paid on delivery
I am able to successfully create calendar events on Google Calendar thanks to the great demo file from DB Services [login to view URL] My question is how to get the script step to successfully attache the file specified. I have very little understanding of json and I am 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 [login to view URL] One example that I am trying is file:///G:/Team Drives/[login to view URL] but no success.
//calculation originated from [login to view URL] 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 ]
)
)
You cannot add attachments from your computer to a calendar event using the API. Only from google drive. Google servers cannot access your machine across the internet to download a file even if you had your ip in the url.