Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Outlook Check if Appointment Conflicts with Lunch #50

Open
wants to merge 22 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
8f56ff4
Create Check-If-Meeting-Clashes-With-Lunch-Break
MattCollins-Jones Jul 26, 2023
9a2ffc4
Delete Check-If-Meeting-Clashes-With-Lunch-Break
MattCollins-Jones Jul 26, 2023
3407abd
Add files via upload
MattCollins-Jones Jul 26, 2023
3ad39c1
Delete samples/Outlook-check-if-meeting-conflicts-with-lunch directory
MattCollins-Jones Jul 26, 2023
cb3e97f
Add files via upload
MattCollins-Jones Jul 26, 2023
94e6fe8
Delete samples/Outlook-check-if-meeting-conflicts-with-lunch directory
MattCollins-Jones Jul 26, 2023
d48117d
Add files via upload
MattCollins-Jones Jul 26, 2023
f2a52c7
Update readme.md
MattCollins-Jones Jul 26, 2023
9546d6e
Update readme.md
MattCollins-Jones Jul 27, 2023
aa689cc
Add files via upload
MattCollins-Jones Jul 28, 2023
4dd2140
Update readme.md
MattCollins-Jones Jul 28, 2023
704c2af
Update readme.md
MattCollins-Jones Jul 31, 2023
2460b19
Update readme.md
MattCollins-Jones Aug 1, 2023
c820468
Update readme.md
MattCollins-Jones Aug 1, 2023
17e202f
Update readme.md
MattCollins-Jones Aug 1, 2023
bf402f5
Update readme.md
MattCollins-Jones Aug 4, 2023
b2eeb62
Update readme.md
MattCollins-Jones Aug 4, 2023
00a0224
Delete samples/Button-create-temp-meeting directory
MattCollins-Jones Aug 4, 2023
d7c23c5
Delete samples/Outlook-check-if-meeting-conflicts-with-lunch directory
MattCollins-Jones Aug 4, 2023
9e5b082
Uploaded Outlook check Lunch
MattCollins-Jones Aug 4, 2023
1d00384
Merge pull request #1 from MattCollins-Jones/MattCollins-Jones-OutLoo…
MattCollins-Jones Aug 4, 2023
2598e28
Merge branch 'pnp:main' into main
MattCollins-Jones Aug 4, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
83 changes: 83 additions & 0 deletions samples/Outlook-check-if-meeting-conflicts-with-lunch/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
# Outlook - Check if meeting conflicts with lunch

## Summary

This flow checks when new appointments are added to your outlook calendar. If checks to see if an existing appointment titled "Lunch". If the appointment that was sent clashes with the Lunch appointment you have in your Outlook Calendar, it sends a reply to the person. This is configurable to the domain the person sent it from. In this sample, it rejects the appointment if it's sent by someone internally and tentatively accepts if sent externally. Both have configurable messages to each of the replies.

![Collapsed Flow](assets/CollapseFlow.png)
![Check Conditions](assets/CheckConditions.png)
![Whole Flow](assets/WholeFlow.png)

## Applies to

* [Microsoft Power Automate](https://docs.microsoft.com/power-automate/)
* [Microsof Outlook](https://learn.microsoft.com/en-us/outlook/)

## Compatibility

![Premium License](https://img.shields.io/badge/Premium%20License-Not%20Required-green.svg "Premium license not required")
![On-Premises Connectors](https://img.shields.io/badge/On--Premises%20Connectors-No-green.svg "Does not use on-premise connectors")
![Custom Connectors](https://img.shields.io/badge/Custom%20Connectors-Not%20Required-green.svg "Does not use custom connectors")

## Authors

Solution|Author(s)
--------|---------
folder name | [Matt Collins-Jones](https://github.com/MattCollins-Jones) ([@D365Geek](https://github.com/MattCollins-Jones))

## Version history

Version|Date|Comments
-------|----|--------
1.0|Feburary 11, 2022|Initial release

## Features

This sample demonstrates:

* Triggering a flow from an Outlook Appointment being receieved
* Filtering an Outlook Calendar to and retrieving entries using the time from the trigger and a keyword "Lunch"
* Replying to the appointment
* Customisable message for people internal or external to the company you work but this can be customised further for specific email domains


## Minimal Path to Awesome

* [Download](./solution/Sample.zip) the `.zip` from the `solution` folder
* Within **Power Automate Studio**, import the solution `.zip` file using **Solutions** > **Import Solution** and select the `.zip` file you just packed.

## Using the Source Code

You can also use the [Power Apps CLI](https://docs.microsoft.com/powerapps/developer/data-platform/powerapps-cli) to pack the source code by following these steps::

* Clone the repository to a local drive
* Pack the source files back into a solution `.zip` file:
```bash
pac solution pack --zipfile pathtodestinationfile --folder pathtosourcefolder --processCanvasApps
```
Making sure to replace `pathtosourcefolder` to point to the path to this sample's `sourcecode` folder, and `pathtodestinationfile` to point to the path of this solution's `.zip` file (located under the `solution` folder)
* Within **Power Automate Studio**, import the solution `.zip` file using **Solutions** > **Import Solution** and select the `.zip` file you just packed.

## Disclaimer

**THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.**

## Help


We do not support samples, but we this community is always willing to help, and we want to improve these samples. We use GitHub to track issues, which makes it easy for community members to volunteer their time and help resolve issues.

If you encounter any issues while using this sample, [create a new issue](https://github.com/pnp/powerautomate-samples/issues/new?assignees=&labels=Needs%3A+Triage+%3Amag%3A%2Ctype%3Abug-suspected&template=bug-report.yml&sample=YOURSAMPLENAME&authors=@YOURGITHUBUSERNAME&title=YOURSAMPLENAME%20-%20).

For questions regarding this sample, [create a new question](https://github.com/pnp/powerautomate-samples/issues/new?assignees=&labels=Needs%3A+Triage+%3Amag%3A%2Ctype%3Abug-suspected&template=question.yml&sample=YOURSAMPLENAME&authors=@YOURGITHUBUSERNAME&title=YOURSAMPLENAME%20-%20).

Finally, if you have an idea for improvement, [make a suggestion](https://github.com/pnp/powerautomate-samples/issues/new?assignees=&labels=Needs%3A+Triage+%3Amag%3A%2Ctype%3Abug-suspected&template=suggestion.yml&sample=YOURSAMPLENAME&authors=@YOURGITHUBUSERNAME&title=YOURSAMPLENAME%20-%20).

## For more information

- [Create your first flow](https://docs.microsoft.com/en-us/power-automate/getting-started#create-your-first-flow)
- [Microsoft Power Automate documentation](https://docs.microsoft.com/en-us/power-automate/)


<img src="https://telemetry.sharepointpnp.com/powerautomate-samples/samples/readme-template" />

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"shared_office365":"837008d6-4f3a-404d-93fd-25a549106e30"}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"shared_office365":"0fa648b9-1075-4002-a0bb-42ae542e5f9d"}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"name":"48d115e6-4a29-414f-9649-baf73a9d11ce","id":"/providers/Microsoft.Flow/flows/48d115e6-4a29-414f-9649-baf73a9d11ce","type":"Microsoft.Flow/flows","properties":{"apiId":"/providers/Microsoft.PowerApps/apis/shared_logicflows","displayName":"Outlook - Check if Conflicts with Lunch","definition":{"metadata":{"workflowEntityId":null,"processAdvisorMetadata":null,"flowclientsuspensionreason":"None","flowclientsuspensiontime":null,"creator":{"id":"bc9b2c30-f572-4c08-848c-5b610d19d918","type":"User","tenantId":"93ae279c-fe6d-4b8e-a851-aa4463187a47"},"provisioningMethod":"FromDefinition","failureAlertSubscription":true,"clientLastModifiedTime":"2022-02-14T17:15:33.675471Z"},"$schema":"https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#","contentVersion":"1.0.0.0","parameters":{"$connections":{"defaultValue":{},"type":"Object"},"$authentication":{"defaultValue":{},"type":"SecureObject"}},"triggers":{"When_an_event_is_added,_updated_or_deleted_(V3)":{"splitOn":"@triggerOutputs()?['body/value']","metadata":{"operationMetadataId":"7c94f170-e23b-4daf-a43a-45c49c619de3"},"type":"OpenApiConnectionNotification","inputs":{"host":{"apiId":"/providers/Microsoft.PowerApps/apis/shared_office365","connectionName":"shared_office365","operationId":"CalendarGetOnChangedItemsV3"},"parameters":{"table":"AAMkADFmNmZkZDgyLWJmYzctNGI1Mi04YTM3LTQ0OTAwZjI5NDg2MABGAAAAAABEx8r0d0KLT5HwlNDHZMznBwBvo3hxj5iHS7nzuFP6_9VyAAAAAAEGAABvo3hxj5iHS7nzuFP6_9VyAAACq97NAAA=","incomingDays":300,"pastDays":50},"authentication":"@parameters('$authentication')"},"conditions":[{"expression":"@not(equals(triggerOutputs()?['body/ActionType'], 'deleted'))"}],"description":"This filters Deleted events, just update the calendar to be the right calendar."}},"actions":{"Terminate":{"runAfter":{"Check_if_lunch_exists_at_this_time":["Succeeded"]},"metadata":{"operationMetadataId":"04a354d5-3de5-447a-8f7c-77da0e696abc"},"type":"Terminate","inputs":{"runStatus":"Succeeded"}},"Get_event_(V3)":{"runAfter":{},"metadata":{"operationMetadataId":"cd66ec51-a995-4815-9609-1855bbafbe67"},"type":"OpenApiConnection","inputs":{"host":{"apiId":"/providers/Microsoft.PowerApps/apis/shared_office365","connectionName":"shared_office365","operationId":"V3CalendarGetItem"},"parameters":{"table":"AAMkADFmNmZkZDgyLWJmYzctNGI1Mi04YTM3LTQ0OTAwZjI5NDg2MABGAAAAAABEx8r0d0KLT5HwlNDHZMznBwBvo3hxj5iHS7nzuFP6_9VyAAAAAAEGAABvo3hxj5iHS7nzuFP6_9VyAAACq97NAAA=","id":"@triggerOutputs()?['body/id']"},"authentication":"@parameters('$authentication')"}},"Get_calendar_view_of_events_(V3)":{"runAfter":{"Get_event_(V3)":["Succeeded"]},"metadata":{"operationMetadataId":"1998a542-e971-4e36-92d0-570bbcd3ffba"},"type":"OpenApiConnection","inputs":{"host":{"apiId":"/providers/Microsoft.PowerApps/apis/shared_office365","connectionName":"shared_office365","operationId":"GetEventsCalendarViewV3"},"parameters":{"calendarId":"AAMkADFmNmZkZDgyLWJmYzctNGI1Mi04YTM3LTQ0OTAwZjI5NDg2MABGAAAAAABEx8r0d0KLT5HwlNDHZMznBwBvo3hxj5iHS7nzuFP6_9VyAAAAAAEGAABvo3hxj5iHS7nzuFP6_9VyAAACq97NAAA=","startDateTimeUtc":"@addMinutes(triggerOutputs()?['body/start'],1)","endDateTimeUtc":"@addMinutes(triggerOutputs()?['body/end'],-1)","search":"Lunch"},"authentication":"@parameters('$authentication')"}},"Check_if_lunch_exists_at_this_time":{"actions":{"Check_if_internal_or_external_contact":{"actions":{"Send_Decline_to_Internal_Contact":{"runAfter":{},"metadata":{"operationMetadataId":"0f89f3d9-eccb-4926-8a5f-07a02cf7925f"},"type":"OpenApiConnection","inputs":{"host":{"apiId":"/providers/Microsoft.PowerApps/apis/shared_office365","connectionName":"shared_office365","operationId":"RespondToEvent_V2"},"parameters":{"event_id":"@triggerOutputs()?['body/id']","response":"decline","body/Comment":"You have tried to schedule an event during my lunch hours, please reschedule else I will not be in attendance.","body/SendResponse":true},"authentication":"@parameters('$authentication')"}}},"runAfter":{},"else":{"actions":{"Send_Polite_Tentative_Accept":{"runAfter":{},"metadata":{"operationMetadataId":"6127e02c-134c-46c9-97d3-42c1cb1e859b"},"type":"OpenApiConnection","inputs":{"host":{"apiId":"/providers/Microsoft.PowerApps/apis/shared_office365","connectionName":"shared_office365","operationId":"RespondToEvent_V2"},"parameters":{"event_id":"@triggerOutputs()?['body/id']","response":"tentativelyAccept","body/Comment":"Hello\n\nI'm afriad you have sent me an invite that clashes with my lunch. I hope you can appreciate we all needs breaks. If you could re-arrange that would be great, if not please let me know and I will try and take my break at another time if possible, but I cannot gaurentee my attendance.\n\nKind Regards","body/SendResponse":true},"authentication":"@parameters('$authentication')"}}}},"expression":{"contains":["@triggerOutputs()?['body/organizer']","companyEmail.com"]},"metadata":{"operationMetadataId":"ee2cb2a4-0178-41a7-b2fb-50f60601a91b"},"type":"If"}},"runAfter":{"Get_calendar_view_of_events_(V3)":["Succeeded"]},"expression":{"equals":["@length(outputs('Get_calendar_view_of_events_(V3)')?['body/value'])",1]},"metadata":{"operationMetadataId":"ff894bfb-eb9f-4b2e-ad59-bc0df570fe67"},"type":"If"}},"outputs":{}},"connectionReferences":{"shared_office365":{"connectionName":"shared-office365-c8abcb91-e34c-454b-97d1-546648006876","source":"Embedded","id":"/providers/Microsoft.PowerApps/apis/shared_office365","tier":"NotSpecified"}},"flowFailureAlertSubscribed":false}}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"packageSchemaVersion":"1.0","flowAssets":{"assetPaths":["04e61882-79fa-4668-803e-b26699ee94ab"]}}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"schema":"1.0","details":{"displayName":"Outlook - Check if Conflicts with Lunch V1.1","description":"","createdTime":"2022-02-14T17:27:21.7475124Z","packageTelemetryId":"2e29b6d7-10d1-4501-be24-80e3f254f983","creator":"N/A","sourceEnvironment":""},"resources":{"04e61882-79fa-4668-803e-b26699ee94ab":{"type":"Microsoft.Flow/flows","suggestedCreationType":"New","creationType":"Existing, New, Update","details":{"displayName":"Outlook - Check if Conflicts with Lunch"},"configurableBy":"User","hierarchy":"Root","dependsOn":["837008d6-4f3a-404d-93fd-25a549106e30","0fa648b9-1075-4002-a0bb-42ae542e5f9d"]},"837008d6-4f3a-404d-93fd-25a549106e30":{"id":"/providers/Microsoft.PowerApps/apis/shared_office365","name":"shared_office365","type":"Microsoft.PowerApps/apis","suggestedCreationType":"Existing","details":{"displayName":"Office 365 Outlook","iconUri":"https://connectoricons-prod.azureedge.net/releases/v1.0.1538/1.0.1538.2621/office365/icon.png"},"configurableBy":"System","hierarchy":"Child","dependsOn":[]},"0fa648b9-1075-4002-a0bb-42ae542e5f9d":{"type":"Microsoft.PowerApps/apis/connections","suggestedCreationType":"Existing","creationType":"Existing","details":{"displayName":"[email protected]","iconUri":"https://connectoricons-prod.azureedge.net/releases/v1.0.1381/1.0.1381.2096/office365/icon.png"},"configurableBy":"User","hierarchy":"Child","dependsOn":["837008d6-4f3a-404d-93fd-25a549106e30"]}}}