When working with Outlook, managing a growing number of emails becomes difficult very quickly. Important messages like invoices, resumes, or client updates often get lost in a crowded inbox, making it hard to stay organized and respond on time.

Most users try to handle this with manual folders or static rules, but these solutions don’t scale well as email patterns keep changing. This leads to extra effort, missed emails, and reduced productivity.

Goal

Screenshot - 2026-06-02T172529.415

Step-wise Implementation

1 - Create flow

Screenshot - 2026-06-02T172741.779

2 - Initialize variable for subject

trim(split(triggerOutputs()?['body/subject'], '-')[0])
Screenshot - 2026-06-02T172808.703

3 - Check folder exist

https://graph.microsoft.com/v1.0/me/mailFolders?$filter=displayName eq '@{variables('varSubject')}'
Screenshot - 2026-06-02T172930.497

4 - Filter records of Check folder exist

@equals(item()?['displayName'], variables('varSubject'))
Screenshot - 2026-06-02T173252.311

5 - Add Condition

length(body('Filter_array')) is not equal to 0
Screenshot - 2026-06-02T173321.936

6 - Yes section (Move mail to already created folder)

Uri:

https://graph.microsoft.com/v1.0/me/messages/@{triggerOutputs()?['body/id']}/move

Body:

{
  'destinationId': '@{first(body('Send_an_HTTP_request_-_Check_folder_exist')?['value'])?['id']}'
}
Screenshot - 2026-06-02T173603.108

7 - No section (Create folder then move mail to that folder)

1 - Create folder

Uri:

https://graph.microsoft.com/v1.0/me/mailFolders

Body:

{
'displayName': '@{variables('varSubject')}',
'parentFolderId': 'AQMkADgzODA4YjI3LWY1ZDktNDYxZS1hMmJhLTg5NTc3ADk2MGQxYTQALgAAA8F7eCT-O3RBuqORFOIoQxMBABdTtfS6Z39GkKhT-7qE4UAAAAIBCAAAAA=='
}
Screenshot - 2026-06-02T174032.652

2 - Move mail to newly created folder

Uri:

https://graph.microsoft.com/v1.0/me/messages/@{triggerOutputs()?['body/id']}/move

Body:

{
  'destinationId': '@{body('Send_an_HTTP_request_-_Create_folder_2')?['id']}'
}
Screenshot - 2026-06-02T174433.934

Conclusion

Here, we learnt that how we can automate this hectic process of Mail using Power Automate.