Showing results for 
Search instead for 
Did you mean: 
Helper III
Helper III

can we copy file by creating folder dynamically based up on subject in an email?

Hello Everyone,

I am having an issue in finding a solution to create file in one of the main site and then dynamically copy to other sites based up on the subject and clientName.


My currentFlow: 


  1. Action: When a new email arrives
  2. Action: Switch
    1. Inside switch it will be “subject” from 1st
  3. Case = Tickets
  4. Action: Apply to each
    1. Action: Get attachment -  from 1st action
    2. Action: Create file (it will be created under a folder based up on subject name)
    3. Action: Compose (first(split(body('Create_File')?['Name'],' tickets)))


The reason I am doing split is that I want to separate by clientName and the Tickets as name. Example if the attachment is “Florida – tickets”, then I want to find out the SharePoint site collection URL based up on client name called “Florida” from a list and then dynamically copy the same file there.

  1. Action: Get Items (here in filer section, if CLientName is equal to compose “output”, then get the associated URL from that item in the list)
  2. Action: Apply to each
    1. Copy file dynamically (clientName will be out of Get-items)

Ex: URL =


Up-until here it works fine. But here I already have folder created in the library and it is copying to that. By what if in future my report/email subject change? Then it should create folder which I am able to create those steps.

Now the fun part. If a new folder is created based up on new subject, then how can I split in Compose “dynamically” and find out clientName? Is it really possible?



Helpful resources

MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.

Users online (2,351)