Hello Community,
I'm trying to build a Flow that runs three times a day and checks the first 10 emails in my inbox to see if they have been read. If they are read, I want the Flow to move them to a specific folder. However, I'm running into an issue where the condition in my Flow never evaluates to TRUE, even for read emails.
My Flow setup includes the following actions:
1. Scheduled trigger (runs three times a day)
2. Get Emails (V3) – Retrieves the first 10 emails.
3. For Each – Iterates over each email.
4. Condition – Checks if `isRead` is `TRUE`.
5. Move Email – Moves the email to a specific folder if the condition is met.
Here are the relevant JSON code snippets:
1. Scheduled trigger:
{
"type": "Recurrence",
"recurrence": {
"frequency": "Day",
"interval": 1,
"timeZone": "W. Europe Standard Time",
"startTime": "2024-10-30T08:00:00.000Z",
"schedule": {
"hours": [
"9",
"16",
"20"
]
}
},
"metadata": {
"operationMetadataId": "ee2ee2ec-6cb4-48a8-bad2-53c4a4e1a7a2"
}
}
2. Get Emails (V3):
{
"type": "OpenApiConnection",
"inputs": {
"parameters": {
"folderPath": "Id::AAMkAGZhMWNkY2E5LTg5ZDEtNGRkOC04MWI0LTQwYzhjYzFmYzY1MQAuAAAAAADRvOHmFy9mQpguzszks1X6AQCG8xLIbntMRJMcflrSuhwiAAAAAAEMAAA=",
"fetchOnlyUnread": false,
"top": 10
},
"host": {
"apiId": "/providers/Microsoft.PowerApps/apis/shared_office365",
"connection": "shared_office365",
"operationId": "GetEmailsV3"
}
},
"metadata": {
"operationMetadataId": "94e71b45-f1ca-4bc2-8f63-10c9ef559588"
}
}
3. For Each:
{
"type": "Foreach",
"foreach": "@outputs('GetEmailsV3')?['body/value']",
"actions": {
"Condition": {
"type": "If",
"expression": {
"and": [
{
"equals": [
"@items('ForEach')?['isRead']",
"True"
]
}
]
},
"actions": {
"Move Email": {
"type": "OpenApiConnection",
"inputs": {
"parameters": {
"messageId": "@items('ForEach')?['id']",
"folderPath": "Id::AAMkAGZhMWNkY2E5LTg5ZDEtNGRkOC04MWI0LTQwYzhjYzFmYzY1MQAuAAAAAADRvOHmFy9mQpguzszks1X6AQCG8xLIbntMRJMcflrSuhwiAAOR8PL0AAA="
}
}
}
},
"else": {
"actions": {}
}
}
}
}
4. Condition:
{
"type": "If",
"expression": {
"and": [
{
"equals": [
"@items('ForEach')?['isRead']",
"True"
]
}
]
},
"actions": {
"Move Email": {
"type": "OpenApiConnection",
"inputs": {
"parameters": {
"messageId": "@items('ForEach')?['id']",
"folderPath": "Id::AAMkAGZhMWNkY2E5LTg5ZDEtNGRkOC04MWI0LTQwYzhjYzFmYzY1MQAuAAAAAADRvOHmFy9mQpguzszks1X6AQCG8xLIbntMRJMcflrSuhwiAAOR8PL0AAA="
},
"host": {
"apiId": "/providers/Microsoft.PowerApps/apis/shared_office365",
"connection": "shared_office365",
"operationId": "MoveV2"
}
}
}
},
"else": {
"actions": {}
}
}
5. Move Email:
{
"type": "OpenApiConnection",
"inputs": {
"parameters": {
"messageId": "@items('ForEach')?['id']",
"folderPath": "Id::AAMkAGZhMWNkY2E5LTg5ZDEtNGRkOC04MWI0LTQwYzhjYzFmYzY1MQAuAAAAAADRvOHmFy9mQpguzszks1X6AQCG8xLIbntMRJMcflrSuhwiAAOR8PL0AAA="
},
"host": {
"apiId": "/providers/Microsoft.PowerApps/apis/shared_office365",
"connection": "shared_office365",
"operationId": "MoveV2"
}
},
"metadata": {
"Id::AAMkAGZhMWNkY2E5LTg5ZDEtNGRkOC04MWI0LTQwYzhjYzFmYzY1MQAuAAAAAADRvOHmFy9mQpguzszks1X6AQCG8xLIbntMRJMcflrSuhwiAAOR8PL0AAA=": "Einsortieren"
}
}
The issue I'm facing is that the condition in my For Each loop always evaluates to FALSE, even when the `isRead` property should be TRUE. Any advice on how to debug or fix this issue would be greatly appreciated!