{"id":"b857d356-f4dc-4742-b085-633d4152dd88","brandColor":"#8C3900","connectionReferences":{"shared_outlook":{"connection":{"id":"/providers/Microsoft.PowerApps/apis/shared_outlook/connections/c89f73fd9d3443708690aeee75715324"}}},"connectorDisplayName":"Control","icon":"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIHZlcnNpb249IjEuMSIgdmlld0JveD0iMCAwIDMyIDMyIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPg0KIDxwYXRoIGQ9Im0wIDBoMzJ2MzJoLTMyeiIgZmlsbD0iIzhDMzkwMCIvPg0KIDxwYXRoIGQ9Im04IDEwaDE2djEyaC0xNnptMTUgMTF2LTEwaC0xNHYxMHptLTItOHY2aC0xMHYtNnptLTEgNXYtNGgtOHY0eiIgZmlsbD0iI2ZmZiIvPg0KPC9zdmc+DQo=","isTrigger":false,"operationName":"Scope","operationDefinition":{"type":"Scope","actions":{"Compose_AddressToForward_(parameter)":{"type":"Compose","inputs":"blackhole@devnull.facebook.com","runAfter":{},"description":"Use or 'blackhole@devnull.facebook.com' or your own address here","metadata":{"operationMetadataId":"0ed66b8c-bfa8-4edc-8d29-3faddc67af93"}},"Get_contacts_(see_advanced_options)":{"type":"OpenApiConnection","inputs":{"host":{"connectionName":"shared_outlook","operationId":"ContactGetItems","apiId":"/providers/Microsoft.PowerApps/apis/shared_outlook"},"parameters":{"table":"AQMkADAwATM0MDAAMS02NGJhLTBiMzgtMDACLTAwCgAuAAAD6wi9g_JRn02oGSRYeH-PXwEAcCMifdib_kKbqzQFCuj2hAAAAgEOAAAA","$filter":"GivenName eq 'DeleteItemsInJunkFolder'","$top":1},"authentication":"@parameters('$authentication')"},"runAfter":{"Compose_AddressToForward_(parameter)":["Succeeded"]},"metadata":{"operationMetadataId":"081428d9-6d77-4e89-9930-acf8f64133cc"}},"Compose_WordsToFilter":{"type":"Compose","inputs":"@outputs('Get_contacts_(see_advanced_options)')?['body/value'][0]?['categories']","runAfter":{"Get_contacts_(see_advanced_options)":["Succeeded"]},"metadata":{"operationMetadataId":"1c94c273-c36c-45b1-a3bb-edfd49074f15"}},"Condition_if_WordsToFilter_is_empty":{"type":"If","expression":{"equals":["@empty(outputs('Compose_WordsToFilter'))","@true"]},"actions":{},"runAfter":{"Compose_WordsToFilter":["Succeeded"]},"else":{"actions":{"Apply_to_each":{"type":"Foreach","foreach":"@triggerOutputs()?['body/value']","actions":{"Compose_SenderName":{"type":"Compose","inputs":"@toUpper(trim(split(split(split(outputs('Get_emails_(V2)')?['body']?['value'][0]?['BodyPreview'], concat(decodeUriComponent('%0A'), 'From:'))?[1], decodeUriComponent('%0A'))[0], '<')[0]))","runAfter":{"Get_emails_(V2)":["Succeeded","Failed","Skipped","TimedOut"]},"metadata":{"operationMetadataId":"b84dc67a-82e3-4c67-b6b0-51dd087fb9c1"}},"Delete_email_in_Sent_Items_folder":{"type":"OpenApiConnection","inputs":{"host":{"connectionName":"shared_outlook","operationId":"DeleteEmail","apiId":"/providers/Microsoft.PowerApps/apis/shared_outlook"},"parameters":{"messageId":"@outputs('Get_emails_(V2)')?['body']?['value'][0]?['id']"},"authentication":"@parameters('$authentication')"},"runAfter":{"Compose_SenderName":["Succeeded","Failed","Skipped","TimedOut"]},"metadata":{"operationMetadataId":"eec6d472-d0a8-43d7-a208-5a027ab34296"}},"Condition_if_you_sent_to_noreply_address":{"type":"If","expression":{"or":[{"equals":["@StartsWith(ToUpper(outputs('Compose_AddressToForward_(parameter)')),'NOREPLY')","@true"]},{"equals":["@StartsWith(ToUpper(outputs('Compose_AddressToForward_(parameter)')),'BLACKHOLE')","@true"]}]},"actions":{},"runAfter":{"Delete_email_in_Sent_Items_folder":["Succeeded","Failed","Skipped","TimedOut"]},"else":{"actions":{"Get_emails_(V2)_2":{"type":"OpenApiConnection","inputs":{"host":{"connectionName":"shared_outlook","operationId":"GetEmailsV2","apiId":"/providers/Microsoft.PowerApps/apis/shared_outlook"},"parameters":{"folderPath":"Id::AQMkADAwATM0MDAAMS02NGJhLTBiMzgtMDACLTAwCgAuAAAD6wi9g_JRn02oGSRYeH-PXwEAcCMifdib_kKbqzQFCuj2hAAAAgEMAAAA","to":"@outputs('Compose_AddressToForward_(parameter)')","fetchOnlyUnread":false,"includeAttachments":false,"searchQuery":"body:@{outputs('Compose_GUID')}","top":1,"importance":"Any","fetchOnlyWithAttachment":false},"authentication":"@parameters('$authentication')"},"runAfter":{"Delay_until_(3_seconds_after_deleting)_":["Succeeded"]},"metadata":{"Id::AQMkADAwATNiZmYAZC05YmFkLTg1NmUtMDACLTAwCgAuAAAD4FA3Y0gyLUWFtW9tnixqagABAMQsBfJLMBdNqsH_qr2dAksAAAIBCQAAAA==":"Sent Items","operationMetadataId":"7b7d1dd4-de56-4b21-8304-562da08bbc6f","Id::AQMkADAwATM0MDAAMS02NGJhLTBiMzgtMDACLTAwCgAuAAAD6wi9g_JRn02oGSRYeH-PXwEAcCMifdib_kKbqzQFCuj2hAAAAgEMAAAA":"Inbox"}},"Delete_email_in_Inbox":{"type":"OpenApiConnection","inputs":{"host":{"connectionName":"shared_outlook","operationId":"DeleteEmail","apiId":"/providers/Microsoft.PowerApps/apis/shared_outlook"},"parameters":{"messageId":"@outputs('Get_emails_(V2)_2')?['body/value'][0]?['id']"},"authentication":"@parameters('$authentication')"},"runAfter":{"Get_emails_(V2)_2":["Succeeded","Failed","Skipped","TimedOut"]},"metadata":{"operationMetadataId":"eec6d472-d0a8-43d7-a208-5a027ab34296"}},"Delay_until_(3_seconds_after_deleting)_":{"type":"Wait","inputs":{"until":{"timestamp":"@{addSeconds(utcNow(), 3)}"}},"runAfter":{},"metadata":{"operationMetadataId":"6af6f551-39e1-4707-8211-f27e68a71998"}}}},"metadata":{"operationMetadataId":"441bfb5d-7dd7-450e-87d4-64dd9202bbab"}},"Condition_if_SenderName_is_not_empty":{"type":"If","expression":{"equals":["@empty(outputs('Compose_SenderName'))","@false"]},"actions":{"Filter_array":{"type":"Query","inputs":{"from":"@outputs('Compose_WordsToFilter')","where":"@and(not(empty(item())), contains(outputs('Compose_SenderName'), toUpper(item())))"},"runAfter":{},"metadata":{"operationMetadataId":"4ecccb07-77cc-494d-9809-879ed36c757a"}},"Condition_if_Filter_array_is_empty":{"type":"If","expression":{"equals":["@empty(body('Filter_array'))","@true"]},"actions":{},"runAfter":{"Filter_array":["Succeeded"]},"else":{"actions":{"Delete_email_in_Junk_folder":{"type":"OpenApiConnection","inputs":{"host":{"connectionName":"shared_outlook","operationId":"DeleteEmail","apiId":"/providers/Microsoft.PowerApps/apis/shared_outlook"},"parameters":{"messageId":"@items('Apply_to_each')?['Id']"},"authentication":"@parameters('$authentication')"},"runAfter":{},"metadata":{"operationMetadataId":"eec6d472-d0a8-43d7-a208-5a027ab34296"}},"Compose_RunAfter":{"type":"Compose","inputs":"Fake compose just to set Run After","runAfter":{"Delete_email_in_Junk_folder":["Succeeded","Failed","Skipped","TimedOut"]},"metadata":{"operationMetadataId":"4562497b-9c4b-416d-8cfb-fb29a99614dc"}}}},"metadata":{"operationMetadataId":"a5116c85-d8bd-458f-b703-83f356d52d58"}}},"runAfter":{"Condition_if_you_sent_to_noreply_address":["Succeeded"]},"metadata":{"operationMetadataId":"cbdeb68e-a966-4956-bf2b-88848f38d82c"}},"Forward_an_email":{"type":"OpenApiConnection","inputs":{"host":{"connectionName":"shared_outlook","operationId":"ForwardEmail","apiId":"/providers/Microsoft.PowerApps/apis/shared_outlook"},"parameters":{"message_id":"@items('Apply_to_each')?['Id']","body/ToRecipients":"@outputs('Compose_AddressToForward_(parameter)')","body/Comment":"@outputs('Compose_GUID')"},"authentication":"@parameters('$authentication')"},"runAfter":{"Compose_GUID":["Succeeded"]},"limit":{"timeout":"PT1M"},"metadata":{"operationMetadataId":"14662cad-0f91-486f-ba4b-a88026db405e"}},"Compose_GUID":{"type":"Compose","inputs":"@guid()","runAfter":{},"metadata":{"operationMetadataId":"e6a86e27-610b-4626-9fe6-be7b038408e7"}},"Delay_until_(3_seconds_after_forwarding)__":{"type":"Wait","inputs":{"until":{"timestamp":"@{addSeconds(utcNow(),3)}"}},"runAfter":{"Forward_an_email":["Succeeded","Failed","Skipped","TimedOut"]},"metadata":{"operationMetadataId":"e8fb1ed4-a440-4380-8615-cf4c2c3fcf1e"}},"Get_emails_(V2)":{"type":"OpenApiConnection","inputs":{"host":{"connectionName":"shared_outlook","operationId":"GetEmailsV2","apiId":"/providers/Microsoft.PowerApps/apis/shared_outlook"},"parameters":{"folderPath":"Id::AQMkADAwATM0MDAAMS02NGJhLTBiMzgtMDACLTAwCgAuAAAD6wi9g_JRn02oGSRYeH-PXwEAcCMifdib_kKbqzQFCuj2hAAAAgEJAAAA","to":"@outputs('Compose_AddressToForward_(parameter)')","fetchOnlyUnread":false,"includeAttachments":false,"searchQuery":"body:@{outputs('Compose_GUID')}","top":1,"importance":"Any","fetchOnlyWithAttachment":false},"authentication":"@parameters('$authentication')"},"runAfter":{"Delay_until_(3_seconds_after_forwarding)__":["Succeeded","Failed","Skipped","TimedOut"]},"metadata":{"Id::AQMkADAwATNiZmYAZC05YmFkLTg1NmUtMDACLTAwCgAuAAAD4FA3Y0gyLUWFtW9tnixqagABAMQsBfJLMBdNqsH_qr2dAksAAAIBCQAAAA==":"Sent Items","operationMetadataId":"7b7d1dd4-de56-4b21-8304-562da08bbc6f","Id::AQMkADAwATM0MDAAMS02NGJhLTBiMzgtMDACLTAwCgAuAAAD6wi9g_JRn02oGSRYeH-PXwEAcCMifdib_kKbqzQFCuj2hAAAAgEJAAAA":"Sent Items"}}},"runAfter":{},"metadata":{"operationMetadataId":"d34e119e-f6c2-47f3-9338-46452d6d97a6"}}}},"metadata":{"operationMetadataId":"c39f6e5e-2272-499e-afac-d1b9ce52cc5a"}}},"runAfter":{},"metadata":{"operationMetadataId":"7489d815-2209-4c97-935f-1434575adeb4"}}}