diff --git a/samples/Outlook-check-if-meeting-conflicts-with-lunch/assets/CheckConditions.png b/samples/Outlook-check-if-meeting-conflicts-with-lunch/assets/CheckConditions.png new file mode 100644 index 0000000..d36b4c0 Binary files /dev/null and b/samples/Outlook-check-if-meeting-conflicts-with-lunch/assets/CheckConditions.png differ diff --git a/samples/Outlook-check-if-meeting-conflicts-with-lunch/assets/CollapseFlow.png b/samples/Outlook-check-if-meeting-conflicts-with-lunch/assets/CollapseFlow.png new file mode 100644 index 0000000..c012550 Binary files /dev/null and b/samples/Outlook-check-if-meeting-conflicts-with-lunch/assets/CollapseFlow.png differ diff --git a/samples/Outlook-check-if-meeting-conflicts-with-lunch/assets/WholeFlow.png b/samples/Outlook-check-if-meeting-conflicts-with-lunch/assets/WholeFlow.png new file mode 100644 index 0000000..1fc8698 Binary files /dev/null and b/samples/Outlook-check-if-meeting-conflicts-with-lunch/assets/WholeFlow.png differ diff --git a/samples/Outlook-check-if-meeting-conflicts-with-lunch/readme.md b/samples/Outlook-check-if-meeting-conflicts-with-lunch/readme.md new file mode 100644 index 0000000..fbb68ed --- /dev/null +++ b/samples/Outlook-check-if-meeting-conflicts-with-lunch/readme.md @@ -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. + + + + + +## Applies to + +* [Microsoft Power Automate](https://docs.microsoft.com/power-automate/) +* [Microsof Outlook](https://learn.microsoft.com/en-us/outlook/) + +## Compatibility + + + + + +## 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" /> + diff --git a/samples/Outlook-check-if-meeting-conflicts-with-lunch/sourcecode/Microsoft.Flow/flows/04e61882-79fa-4668-803e-b26699ee94ab/apisMap.json b/samples/Outlook-check-if-meeting-conflicts-with-lunch/sourcecode/Microsoft.Flow/flows/04e61882-79fa-4668-803e-b26699ee94ab/apisMap.json new file mode 100644 index 0000000..2e606e8 --- /dev/null +++ b/samples/Outlook-check-if-meeting-conflicts-with-lunch/sourcecode/Microsoft.Flow/flows/04e61882-79fa-4668-803e-b26699ee94ab/apisMap.json @@ -0,0 +1 @@ +{"shared_office365":"837008d6-4f3a-404d-93fd-25a549106e30"} \ No newline at end of file diff --git a/samples/Outlook-check-if-meeting-conflicts-with-lunch/sourcecode/Microsoft.Flow/flows/04e61882-79fa-4668-803e-b26699ee94ab/connectionsMap.json b/samples/Outlook-check-if-meeting-conflicts-with-lunch/sourcecode/Microsoft.Flow/flows/04e61882-79fa-4668-803e-b26699ee94ab/connectionsMap.json new file mode 100644 index 0000000..b42887e --- /dev/null +++ b/samples/Outlook-check-if-meeting-conflicts-with-lunch/sourcecode/Microsoft.Flow/flows/04e61882-79fa-4668-803e-b26699ee94ab/connectionsMap.json @@ -0,0 +1 @@ +{"shared_office365":"0fa648b9-1075-4002-a0bb-42ae542e5f9d"} \ No newline at end of file diff --git a/samples/Outlook-check-if-meeting-conflicts-with-lunch/sourcecode/Microsoft.Flow/flows/04e61882-79fa-4668-803e-b26699ee94ab/definition.json b/samples/Outlook-check-if-meeting-conflicts-with-lunch/sourcecode/Microsoft.Flow/flows/04e61882-79fa-4668-803e-b26699ee94ab/definition.json new file mode 100644 index 0000000..6726e57 --- /dev/null +++ b/samples/Outlook-check-if-meeting-conflicts-with-lunch/sourcecode/Microsoft.Flow/flows/04e61882-79fa-4668-803e-b26699ee94ab/definition.json @@ -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}} \ No newline at end of file diff --git a/samples/Outlook-check-if-meeting-conflicts-with-lunch/sourcecode/Microsoft.Flow/flows/manifest.json b/samples/Outlook-check-if-meeting-conflicts-with-lunch/sourcecode/Microsoft.Flow/flows/manifest.json new file mode 100644 index 0000000..31de155 --- /dev/null +++ b/samples/Outlook-check-if-meeting-conflicts-with-lunch/sourcecode/Microsoft.Flow/flows/manifest.json @@ -0,0 +1 @@ +{"packageSchemaVersion":"1.0","flowAssets":{"assetPaths":["04e61882-79fa-4668-803e-b26699ee94ab"]}} \ No newline at end of file diff --git a/samples/Outlook-check-if-meeting-conflicts-with-lunch/sourcecode/manifest.json b/samples/Outlook-check-if-meeting-conflicts-with-lunch/sourcecode/manifest.json new file mode 100644 index 0000000..81d882f --- /dev/null +++ b/samples/Outlook-check-if-meeting-conflicts-with-lunch/sourcecode/manifest.json @@ -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":"matt.collins@TechServiceGroup.onmicrosoft.com","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"]}}} \ No newline at end of file