cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
SjoerdH
Frequent Visitor

If a folder exists with substring(foldername,0,5)==substring(subject,0,5) move that email to said folder

I am trying to automate moving incoming emails to an unspecified folder.

If a folder exists in the inbox that has its first five characters correspond with the incoming email subject's first five character, then the email should be moved to that folder.

 

Is this even possible at this moment with PA?

2 ACCEPTED SOLUTIONS

Accepted Solutions

@SjoerdH so to start with you will need to fetch the list of folder from mailbox in the flow.  You need to use graph api to do this, this blog has the instructions on how to use graph api to get list of folders from mailbox https://sharepains.com/2020/07/01/use-mail-folders-in-microsoft-graph-using-power-automate/ This requires use of http connector which is a premium connector.

Regards,
Anna Jhaveri

If I have answered your question, please mark the post as Solved to help other users to identify the correct answer
If you like my response, please give it a Thumbs Up.

View solution in original post

@SjoerdH in that case you can create Custom Connector in Power automate to use graph api, one custom connector can be create under M365 license. Here are instructions to create custom connectors that use Graph API https://docs.microsoft.com/en-us/graph/tutorials/power-automate. You will need to follow mix of instructions from both articles one is https://sharepains.com/2020/07/01/use-mail-folders-in-microsoft-graph-using-power-automate/ and other is https://docs.microsoft.com/en-us/graph/tutorials/power-automate 

 

if you feel stuck or lost let me know.

Regards,
Anna Jhaveri

If I have answered your question, please mark the post as Solved to help other users to identify the correct answer
If you like my response, please give it a Thumbs Up.

View solution in original post

6 REPLIES 6
annajhaveri
Super User
Super User

@SjoerdH are you trying to move email from one folder to another folder in the same mailbox?

Regards,
Anna Jhaveri

If I have answered your question, please mark the post as Solved to help other users to identify the correct answer
If you like my response, please give it a Thumbs Up.

Not really...

 

1. I want to look at the first five characters of an incoming email's subject

2. I want to compare those five characters to existing Outlook folderNames.

3. If a match is found, I want the incoming email to be moved to that folder

 

It needs to be generic, so I don't need to filter for every folder seperately

@annajhaveri I guess you could state that the incoming email goed to INBOX folder first.

Then it should be moved to the folder that has a name corresponding to the email message's subject. 

@SjoerdH so to start with you will need to fetch the list of folder from mailbox in the flow.  You need to use graph api to do this, this blog has the instructions on how to use graph api to get list of folders from mailbox https://sharepains.com/2020/07/01/use-mail-folders-in-microsoft-graph-using-power-automate/ This requires use of http connector which is a premium connector.

Regards,
Anna Jhaveri

If I have answered your question, please mark the post as Solved to help other users to identify the correct answer
If you like my response, please give it a Thumbs Up.

View solution in original post

SjoerdH
Frequent Visitor

@annajhaveri 
This sounds like the solution, thanks.

I don't have acces to premium connectors unfortunately...

@SjoerdH in that case you can create Custom Connector in Power automate to use graph api, one custom connector can be create under M365 license. Here are instructions to create custom connectors that use Graph API https://docs.microsoft.com/en-us/graph/tutorials/power-automate. You will need to follow mix of instructions from both articles one is https://sharepains.com/2020/07/01/use-mail-folders-in-microsoft-graph-using-power-automate/ and other is https://docs.microsoft.com/en-us/graph/tutorials/power-automate 

 

if you feel stuck or lost let me know.

Regards,
Anna Jhaveri

If I have answered your question, please mark the post as Solved to help other users to identify the correct answer
If you like my response, please give it a Thumbs Up.

View solution in original post

Helpful resources

Announcements
MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

Top Solution Authors
Users online (29,192)