+{"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}}
0 commit comments