For scheduling apps, a useful tip is that we can create a Google calendar event by calling a URL that initiates the creation of an event in a new Google calendar web browser window.
The key to this method is to compose an address in the format that looks like this:
The above address opens Google calendar with the details that we specify through the parameters. The following link provides full details, including how to specify additional values such as recurrence and meeting attendees.
How to create a Google calendar event from a form.
To apply this technique in Power Apps, we compose a URL that matches the format above, and we open it by calling the launch function.
The example syntax would look like this:
Title:"Power Apps Meeting",
Body:"Meeting to discuss Power Apps",
"&dates=" & Text(StartDate, UTC) & "/" &
Text(EndDate, UTC) &
"&location=" & EventLocation &
"&details=" & Body
The most important part is to specify the start and end dates in the correct format. The acceptable formats are
- Specify time in the user's timezone: 20211122T193000/20211122T223000
- Specify time as UTC: 20211122T193000Z/20211122T223000Z
- Specify all-day events: 20211122/20211123
Note that if we want to specify the UTC time and if we attempt to convert a date from Power Apps by calling the Text function and specifying UTC, Power Apps adds hyphen and semicolon characters to the output. The Google implementation does not recognise UTC date times with these characters, therefore it would be necessary to strip these characters when we construct the URL.
When we now run this formula, Google calendar will open in a new window with pre-populated values, as shown in the screenshot beneath.
In cases where we want to add events to a Google calendar, we can accomplish this task by composing a URL that opens Google calendar with prefilled values and launching this URL from a Power Apps screen