Google Calendar questions

My goal is simple, duplicate a 3rd party calendar into google calendar. Execution seems tougher.

I have been able to extract calendar json data from the source calendar with each appt being a separate item. This where things get tricky and I have many questions

Question 1

How do I insert all the appointments (items in the json) into google cal using a single google cal node? It seems to me that I will need to have a google cal node for each item. As the number of items (appointments) will vary from day to day I cant see how to bring in all the appts into google cal?

Question 2

How do I create a title for google cal appt? All the other options like location and description are available in the node but nothing for title.

Question 3

How do I set up a system where a change in the source calendar acts as trigger to update the google cal. I am accessing via a HTTP node so at this point I think a scheduled cron is the only way to do this?

Question 4

Every time the cron runs it will resync existing appts. Testing shows that every time the workflow runs it will create a duplicate appt on the google cal. How can I get it to only add new appts?

Sample of the json file I am working with

[
  {
    "id": 270063267,
    "arrived_at": null,
    "booked_via_api": false,
    "cancelled_at": null,
    "completed_at": null,
    "confirmed_at": "2022-06-27T08:51:29.149+01:00",
    "created_at": "2022-06-27T08:51:29.149+01:00",
    "did_not_attend_at": null,
    "duration": 120,
    "finish_time": "2022-07-27T10:00:00.000+01:00",
    "import_id": null,
    "in_surgery_at": null,
    "metadata": {},
    "notes": "Clinic  Closed",
    "patient_id": null,
    "patient_image_url": "https://assets.dentally.co/assets/no-patient-3144b17787d7458c2d7f123cfbe77016851956869e45c839b26ce8328adfd895.png",
    "patient_name": "",
    "payment_plan_id": null,
    "pending_at": "2022-06-27T08:51:29.149+01:00",
    "practitioner_id": 11507,
    "reason": "Other",
    "room_id": null,
    "start_time": "2022-07-27T08:00:00.000+01:00",
    "state": "Confirmed",
    "treatment_description": null,
    "updated_at": "2022-06-27T08:51:29.149+01:00",
    "user_id": 35440
  },
  {
    "id": 266844302,
    "arrived_at": "2022-07-27T10:01:28.095+01:00",
    "booked_via_api": false,
    "cancelled_at": null,
    "completed_at": "2022-07-27T10:24:53.457+01:00",
    "confirmed_at": "2022-07-25T17:18:10.518+01:00",
    "created_at": "2022-06-21T16:11:47.688+01:00",
    "did_not_attend_at": null,
    "duration": 30,
    "finish_time": "2022-07-27T10:30:00.000+01:00",
    "import_id": null,
    "in_surgery_at": "2022-07-27T10:04:41.698+01:00",
    "metadata": {},
    "notes": "retie",
    "patient_id": 1018,
    "patient_image_url": "https://www.gravatar.com/avatar/xxxxxxx.jpg?&r=pg&d=identicon&s=190",
    "patient_name": "Jane doe",
    "payment_plan_id": 3822,
    "pending_at": "2022-06-21T16:11:47.688+01:00",
    "practitioner_id": 11507,
    "reason": "test ",
    "room_id": null,
    "start_time": "2022-07-27T10:00:00.000+01:00",
    "state": "Completed",
    "treatment_description": "stuff",
    "updated_at": "2022-07-27T10:24:53.457+01:00",
    "user_id": 60507
  },
  {
    "id": 261814307,
    "arrived_at": "2022-07-27T10:22:59.979+01:00",
    "booked_via_api": false,
    "cancelled_at": null,
    "completed_at": "2022-07-27T10:49:38.862+01:00",
    "confirmed_at": "2022-07-26T16:14:03.375+01:00",
    "created_at": "2022-06-15T10:34:06.003+01:00",
    "did_not_attend_at": null,
    "duration": 30,
    "finish_time": "2022-07-27T11:00:00.000+01:00",
    "import_id": null,
    "in_surgery_at": "2022-07-27T10:26:56.850+01:00",
    "metadata": {},
    "notes": null,
    "patient_id": 248,
    "patient_image_url": "https://www.gravatar.com/avatar/xxxxxxx.jpg?&r=pg&d=identicon&s=190",
    "patient_name": "Deb Joe",
    "payment_plan_id": 3822,
    "pending_at": "2022-06-15T10:34:06.003+01:00",
    "practitioner_id": 11507,
    "reason": "Test ",
    "room_id": null,
    "start_time": "2022-07-27T10:30:00.000+01:00",
    "state": "Completed",
    "treatment_description": "stuff",
    "updated_at": "2022-07-27T10:49:38.862+01:00",
    "user_id": 60507
  },
  {
    "id": 261850683,
    "arrived_at": "2022-07-27T11:36:30.140+01:00",
    "booked_via_api": false,
    "cancelled_at": null,
    "completed_at": "2022-07-27T11:48:54.325+01:00",
    "confirmed_at": "2022-07-27T11:36:28.614+01:00",
    "created_at": "2022-06-15T12:36:32.514+01:00",
    "did_not_attend_at": null,
    "duration": 30,
    "finish_time": "2022-07-27T12:00:00.000+01:00",
    "import_id": null,
    "in_surgery_at": "2022-07-27T11:39:15.748+01:00",
    "metadata": {},
    "notes": null,
    "patient_id": 848,
    "patient_image_url": "https://www.gravatar.com/avatar/XXXX.jpg?&r=pg&d=identicon&s=190",
    "patient_name": "Emma doe",
    "payment_plan_id": 10077,
    "pending_at": "2022-06-15T12:36:32.515+01:00",
    "practitioner_id": 11507,
    "reason": "test",
    "room_id": null,
    "start_time": "2022-07-27T11:30:00.000+01:00",
    "state": "Completed",
    "treatment_description": "stuff",
    "updated_at": "2022-07-27T11:48:54.325+01:00",
    "user_id": 60507
  },
  {
    "id": 288419049,
    "arrived_at": "2022-07-27T11:50:38.984+01:00",
    "booked_via_api": false,
    "cancelled_at": null,
    "completed_at": "2022-07-27T12:50:51.224+01:00",
    "confirmed_at": "2022-07-27T11:50:37.974+01:00",
    "created_at": "2022-07-21T16:03:50.657+01:00",
    "did_not_attend_at": null,
    "duration": 45,
    "finish_time": "2022-07-27T12:45:00.000+01:00",
    "import_id": null,
    "in_surgery_at": "2022-07-27T11:56:54.029+01:00",
    "metadata": {},
    "notes": null,
    "patient_id": 1699,
    "patient_image_url": "https://www.gravatar.com/avatar/xxxx.jpg?&r=pg&d=identicon&s=190",
    "patient_name": "Clare doe",
    "payment_plan_id": 3822,
    "pending_at": "2022-07-21T16:03:50.657+01:00",
    "practitioner_id": 11507,
    "reason": "test",
    "room_id": null,
    "start_time": "2022-07-27T12:00:00.000+01:00",
    "state": "Completed",
    "treatment_description": "stuff",
    "updated_at": "2022-07-27T12:50:51.224+01:00",
    "user_id": 86650
  },
  {
    "id": 272487792,
    "arrived_at": "2022-07-27T12:35:13.276+01:00",
    "booked_via_api": false,
    "cancelled_at": null,
    "completed_at": "2022-07-27T13:55:23.148+01:00",
    "confirmed_at": "2022-07-24T12:58:32.226+01:00",
    "created_at": "2022-06-28T17:23:01.846+01:00",
    "did_not_attend_at": null,
    "duration": 30,
    "finish_time": "2022-07-27T13:15:00.000+01:00",
    "import_id": null,
    "in_surgery_at": "2022-07-27T12:51:17.118+01:00",
    "metadata": {},
    "notes": "stuff",
    "patient_id": 1613,
    "patient_image_url": "https://www.gravatar.com/avatar/XXXXX.jpg?&r=pg&d=identicon&s=190",
    "patient_name": "Ruairi doe",
    "payment_plan_id": 3822,
    "pending_at": "2022-06-28T17:23:01.846+01:00",
    "practitioner_id": 11507,
    "reason": "test",
    "room_id": null,
    "start_time": "2022-07-27T12:45:00.000+01:00",
    "state": "Completed",
    "treatment_description": "stuff ",
    "updated_at": "2022-07-27T13:55:23.148+01:00",
    "user_id": 89823
  },
  {
    "id": 288444751,
    "arrived_at": "2022-07-27T13:10:52.238+01:00",
    "booked_via_api": false,
    "cancelled_at": null,
    "completed_at": "2022-07-27T13:55:20.420+01:00",
    "confirmed_at": "2022-07-24T22:58:32.904+01:00",
    "created_at": "2022-07-21T18:06:19.543+01:00",
    "did_not_attend_at": null,
    "duration": 45,
    "finish_time": "2022-07-27T14:00:00.000+01:00",
    "import_id": null,
    "in_surgery_at": "2022-07-27T13:24:56.717+01:00",
    "metadata": {},
    "notes": null,
    "patient_id": 1483,
    "patient_image_url": "https://www.gravatar.com/avatar/xxx.jpg?&r=pg&d=identicon&s=190",
    "patient_name": "Djordje doe",
    "payment_plan_id": 3822,
    "pending_at": "2022-07-21T18:06:19.543+01:00",
    "practitioner_id": 11507,
    "reason": "Otest ",
    "room_id": null,
    "start_time": "2022-07-27T13:15:00.000+01:00",
    "state": "Completed",
    "treatment_description": "test",
    "updated_at": "2022-07-27T13:55:20.420+01:00",
    "user_id": 60507
  },
  {
    "id": 290633179,
    "arrived_at": "2022-07-27T14:00:08.086+01:00",
    "booked_via_api": false,
    "cancelled_at": null,
    "completed_at": "2022-07-27T14:21:08.699+01:00",
    "confirmed_at": "2022-07-27T14:00:07.026+01:00",
    "created_at": "2022-07-27T11:15:40.173+01:00",
    "did_not_attend_at": null,
    "duration": 20,
    "finish_time": "2022-07-27T14:20:00.000+01:00",
    "import_id": null,
    "in_surgery_at": "2022-07-27T14:20:53.563+01:00",
    "metadata": {},
    "notes": "stuff ",
    "patient_id": 1018,
    "patient_image_url": "https://www.gravatar.com/avatar/xxxx.jpg?&r=pg&d=identicon&s=190",
    "patient_name": "Katarzyna doe",
    "payment_plan_id": 3822,
    "pending_at": "2022-07-27T11:15:40.173+01:00",
    "practitioner_id": 11507,
    "reason": "test",
    "room_id": null,
    "start_time": "2022-07-27T14:00:00.000+01:00",
    "state": "Completed",
    "treatment_description": "stuff",
    "updated_at": "2022-07-27T14:21:08.699+01:00",
    "user_id": 126010
  },
  {
    "id": 264251246,
    "arrived_at": null,
    "booked_via_api": false,
    "cancelled_at": null,
    "completed_at": null,
    "confirmed_at": null,
    "created_at": "2022-06-20T12:55:13.263+01:00",
    "did_not_attend_at": null,
    "duration": 40,
    "finish_time": "2022-07-27T15:00:00.000+01:00",
    "import_id": null,
    "in_surgery_at": null,
    "metadata": {},
    "notes": "stuff",
    "patient_id": null,
    "patient_image_url": "https://assets.dentally.co/assets/no-patient-xxx.png",
    "patient_name": "",
    "payment_plan_id": null,
    "pending_at": "2022-06-20T12:55:13.263+01:00",
    "practitioner_id": 11507,
    "reason": "test",
    "room_id": null,
    "start_time": "2022-07-27T14:20:00.000+01:00",
    "state": "Pending",
    "treatment_description": null,
    "updated_at": "2022-07-27T11:15:47.433+01:00",
    "user_id": 86650
  },
  {
    "id": 253543068,
    "arrived_at": "2022-07-27T14:51:05.470+01:00",
    "booked_via_api": false,
    "cancelled_at": null,
    "completed_at": "2022-07-27T15:26:57.122+01:00",
    "confirmed_at": "2022-07-27T14:50:57.961+01:00",
    "created_at": "2022-05-31T15:18:48.785+01:00",
    "did_not_attend_at": null,
    "duration": 30,
    "finish_time": "2022-07-27T15:30:00.000+01:00",
    "import_id": null,
    "in_surgery_at": "2022-07-27T15:07:01.224+01:00",
    "metadata": {},
    "notes": null,
    "patient_id": 1131,
    "patient_image_url": "https://www.gravatar.com/avatar/xxx.jpg?&r=pg&d=identicon&s=190",
    "patient_name": "Yagyansh doe",
    "payment_plan_id": 3822,
    "pending_at": "2022-05-31T15:18:48.785+01:00",
    "practitioner_id": 11507,
    "reason": "test ",
    "room_id": null,
    "start_time": "2022-07-27T15:00:00.000+01:00",
    "state": "Completed",
    "treatment_description": "stuff",
    "updated_at": "2022-07-27T15:26:57.122+01:00",
    "user_id": 60507
  },
  {
    "id": 264145992,
    "arrived_at": "2022-07-27T15:14:59.899+01:00",
    "booked_via_api": false,
    "cancelled_at": null,
    "completed_at": "2022-07-27T16:04:58.937+01:00",
    "confirmed_at": "2022-07-24T16:01:27.190+01:00",
    "created_at": "2022-06-18T12:20:15.022+01:00",
    "did_not_attend_at": null,
    "duration": 30,
    "finish_time": "2022-07-27T16:00:00.000+01:00",
    "import_id": null,
    "in_surgery_at": "2022-07-27T15:34:58.958+01:00",
    "metadata": {},
    "notes": "stuff",
    "patient_id": 1362,
    "patient_image_url": "https://www.gravatar.com/avatar/xxxxx.jpg?&r=pg&d=identicon&s=190",
    "patient_name": "Chloe doe",
    "payment_plan_id": 3822,
    "pending_at": "2022-06-18T12:20:15.022+01:00",
    "practitioner_id": 11507,
    "reason": "test ",
    "room_id": null,
    "start_time": "2022-07-27T15:30:00.000+01:00",
    "state": "Completed",
    "treatment_description": "stuff ",
    "updated_at": "2022-07-27T16:04:58.937+01:00",
    "user_id": 60507
  },
  {
    "id": 264145997,
    "arrived_at": "2022-07-27T15:15:01.079+01:00",
    "booked_via_api": false,
    "cancelled_at": null,
    "completed_at": "2022-07-27T16:03:51.149+01:00",
    "confirmed_at": "2022-07-24T17:03:21.120+01:00",
    "created_at": "2022-06-18T12:20:23.557+01:00",
    "did_not_attend_at": null,
    "duration": 30,
    "finish_time": "2022-07-27T16:30:00.000+01:00",
    "import_id": null,
    "in_surgery_at": "2022-07-27T15:36:31.357+01:00",
    "metadata": {},
    "notes": "stuff ",
    "patient_id": 1361,
    "patient_image_url": "https://www.gravatar.com/avatar/xxxx.jpg?&r=pg&d=identicon&s=190",
    "patient_name": "Lewis doe",
    "payment_plan_id": 3822,
    "pending_at": "2022-06-18T12:20:23.557+01:00",
    "practitioner_id": 11507,
    "reason": "test",
    "room_id": null,
    "start_time": "2022-07-27T16:00:00.000+01:00",
    "state": "Completed",
    "treatment_description": "stuff",
    "updated_at": "2022-07-27T16:03:51.149+01:00",
    "user_id": 60507
  },
  {
    "id": 286841036,
    "arrived_at": "2022-07-27T16:17:34.683+01:00",
    "booked_via_api": false,
    "cancelled_at": null,
    "completed_at": "2022-07-27T17:00:00.000+01:00",
    "confirmed_at": "2022-07-26T16:10:45.292+01:00",
    "created_at": "2022-07-19T15:24:24.624+01:00",
    "did_not_attend_at": null,
    "duration": 30,
    "finish_time": "2022-07-27T17:00:00.000+01:00",
    "import_id": null,
    "in_surgery_at": "2022-07-27T16:36:21.828+01:00",
    "metadata": {},
    "notes": "stuff ",
    "patient_id": 192,
    "patient_image_url": "https://www.gravatar.com/avatar/xxxx.jpg?&r=pg&d=identicon&s=190",
    "patient_name": "Alexis doe",
    "payment_plan_id": 3822,
    "pending_at": "2022-07-19T15:24:24.624+01:00",
    "practitioner_id": 11507,
    "reason": "tstt",
    "room_id": null,
    "start_time": "2022-07-27T16:30:00.000+01:00",
    "state": "Completed",
    "treatment_description": "stuff",
    "updated_at": "2022-07-28T01:10:23.026+01:00",
    "user_id": 126010
  },
  {
    "id": 263831035,
    "arrived_at": "2022-07-27T16:11:35.341+01:00",
    "booked_via_api": false,
    "cancelled_at": null,
    "completed_at": "2022-07-27T17:05:58.736+01:00",
    "confirmed_at": "2022-07-27T16:11:34.381+01:00",
    "created_at": "2022-06-16T17:18:28.198+01:00",
    "did_not_attend_at": null,
    "duration": 30,
    "finish_time": "2022-07-27T17:30:00.000+01:00",
    "import_id": null,
    "in_surgery_at": "2022-07-27T16:38:55.398+01:00",
    "metadata": {},
    "notes": null,
    "patient_id": 1163,
    "patient_image_url": "https://www.gravatar.com/avatar/xxx.jpg?&r=pg&d=identicon&s=190",
    "patient_name": "Kerry doe",
    "payment_plan_id": 3822,
    "pending_at": "2022-06-16T17:18:28.198+01:00",
    "practitioner_id": 11507,
    "reason": "stuff ",
    "room_id": null,
    "start_time": "2022-07-27T17:00:00.000+01:00",
    "state": "Completed",
    "treatment_description": "stuff",
    "updated_at": "2022-07-27T17:05:58.736+01:00",
    "user_id": 60507
  },
  {
    "id": 281816922,
    "arrived_at": "2022-07-27T17:32:49.631+01:00",
    "booked_via_api": false,
    "cancelled_at": null,
    "completed_at": "2022-07-27T18:09:57.077+01:00",
    "confirmed_at": "2022-07-24T18:16:07.644+01:00",
    "created_at": "2022-07-12T16:53:29.587+01:00",
    "did_not_attend_at": null,
    "duration": 30,
    "finish_time": "2022-07-27T18:00:00.000+01:00",
    "import_id": null,
    "in_surgery_at": "2022-07-27T17:36:01.511+01:00",
    "metadata": {},
    "notes": "stuff",
    "patient_id": 771,
    "patient_image_url": "https://www.gravatar.com/avatar/xxxx.jpg?&r=pg&d=identicon&s=190",
    "patient_name": "Calum doe",
    "payment_plan_id": 7131,
    "pending_at": "2022-07-12T16:53:29.587+01:00",
    "practitioner_id": 11507,
    "reason": "test ",
    "room_id": null,
    "start_time": "2022-07-27T17:30:00.000+01:00",
    "state": "Completed",
    "treatment_description": "stuff",
    "updated_at": "2022-07-27T18:14:08.696+01:00",
    "user_id": 126010
  },
  {
    "id": 269474326,
    "arrived_at": null,
    "booked_via_api": false,
    "cancelled_at": null,
    "completed_at": null,
    "confirmed_at": null,
    "created_at": "2022-06-23T16:11:35.290+01:00",
    "did_not_attend_at": null,
    "duration": 120,
    "finish_time": "2022-07-27T20:00:00.000+01:00",
    "import_id": null,
    "in_surgery_at": null,
    "metadata": {},
    "notes": "stuff",
    "patient_id": null,
    "patient_image_url": "https://assets.dentally.co/assets/no-patient-xxx.png",
    "patient_name": "",
    "payment_plan_id": null,
    "pending_at": "2022-06-23T16:11:35.290+01:00",
    "practitioner_id": 11507,
    "reason": "Blocked",
    "room_id": null,
    "start_time": "2022-07-27T18:00:00.000+01:00",
    "state": "Pending",
    "treatment_description": null,
    "updated_at": "2022-07-20T21:38:23.032+01:00",
    "user_id": 89823
  },
  {
    "id": 249159016,
    "arrived_at": null,
    "booked_via_api": false,
    "cancelled_at": null,
    "completed_at": null,
    "confirmed_at": "2022-05-25T11:15:06.287+01:00",
    "created_at": "2022-05-25T11:15:06.287+01:00",
    "did_not_attend_at": null,
    "duration": 60,
    "finish_time": "2022-07-27T21:00:00.000+01:00",
    "import_id": null,
    "in_surgery_at": null,
    "metadata": {},
    "notes": "Clinic closed",
    "patient_id": null,
    "patient_image_url": "https://assets.dentally.co/assets/no-patient-xxx.png",
    "patient_name": "",
    "payment_plan_id": null,
    "pending_at": "2022-05-25T11:15:06.287+01:00",
    "practitioner_id": 11507,
    "reason": "Other",
    "room_id": null,
    "start_time": "2022-07-27T20:00:00.000+01:00",
    "state": "Confirmed",
    "treatment_description": null,
    "updated_at": "2022-05-25T11:15:06.287+01:00",
    "user_id": 86650
  }
] 

Hi @Robm

Q1: The node will run once for every item normally. I don’t think the Google calendar node is any different.

Q2: Could this be the summary? Not sure, I’ve yet to use the Google calendar node.

Q3: Depending on what other calendar that is. If there is no trigger node, which I guess there isn’t. You can still use a webhook if the 3rd party calendar provides that option. Or idd use the Cron Node.

Q4: easiest would probably be to return the google Cal Id to the 3rd party cal so you can reference this when an update is made. Other way is to check the date and time to see if other appts exist and deal with duplicates if you spot them. This however is not bullet proof when changing the time and desc at the same time for example. Or even worse when changing the date.

Hope this helps.

1 Like