web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Moving Emails to Subfo...
Power Automate
Unanswered

Moving Emails to Subfolder in round Robin style

(0) ShareShare
ReportReport
Posted on by 64

Capture.JPGHi All,

 

i have a shared mailbox in which i am running the below script to move the incoming messages to subfolder in round robin style.can we achive this using microsoft flow ? or any other way to automate it in background,

thanks ,

 

Dim i As Long
Private WithEvents olInboxItems As Items
 
Private Sub Application_Startup()
  Dim objNS As NameSpace
  Set objNS = Application.Session
  Set olInboxItems = objNS.GetDefaultFolder(olFolderInbox).Items
Set objNS = Nothing
End Sub

Private Sub olInboxItems_ItemAdd(ByVal Item As Object)

    Dim objDestFolder As Outlook.MAPIFolder
    Dim moveFolder As String
   
    If Item.Class = olMail Then
    
    Select Case i
     Case 0
          moveFolder = "Folder01"
     Case 1
          moveFolder = "Folder02"
     Case 2
          moveFolder = "Folder03"
     Case 3
          moveFolder = "Folder04"
     Case 4
          moveFolder = "Folder05"
    End Select
   
Set objDestFolder = Session.GetDefaultFolder(olFolderInbox).Folders(moveFolder)
  Item.move objDestFolder
        End If
       
        Err.Clear
         
     i = i + 1
     Debug.Print i
     If i = 5 Then i = 0
 Set objDestFolder = Nothing
 End Sub

 

 

I have the same question (0)
  • v-yamao-msft Profile Picture
    on at

    Hi @jaleefpk,

     

    By using Round-robin style, do you mean that you want to choose all elements in a group, usually from the top to the bottom of a list and then starting again at the top of the list and so on?

    There is no direct way could be used to achieve it, while if you are familiar with Custom API, please try integrating Custom APIs with flow. The following docs for your reference:

    https://docs.microsoft.com/en-us/flow/developer/register-custom-api

    By the way, we could also consider using Switch cases if you don’t have too many folders.

    A simple flow likes below for your reference.

    1.PNG

     

    Best regards,

    Mabel

  • jaleefpk Profile Picture
    64 on at

    Hi @v-yamao-msft ,

     

    we have centralized mailbox in which we receive emails from cutomer ,and i have  7 agents to check emails and enter order to our ERP.

    i want to distribute the incoming emails regardless of sender or subject to agents equally .

     

  • v-yamao-msft Profile Picture
    on at

    Hi @jaleefpk,

     

    Thanks for updating.

    It seems that you would like to dispatch the incoming emails to 7 agents regardless of send or subject equally.

    I am afraid that it could not be achieved by using OOB flow actions directly.

     

    Best regards,

    Mabel

  • jaleefpk Profile Picture
    64 on at
    I have done it using flow using the received time.but distribtion to folders are not equal.

    Please let me know if you guys find any option to achieve that
  • entropyeater Profile Picture
    9 on at

    I like this workaround! I also have the same usecase - creating a round-robin distribution - and would like to achieve it through flow. Please let us know if you create a way to do it. 

  • VictorIvanidze Profile Picture
    13,073 on at

    Have a look at https://ivasoft.com/roudrobinsharedflow.shtml

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 525 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 324 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard