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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Verify subfolder exist...
Power Automate
Suggested Answer

Verify subfolder exist and return the path

(0) ShareShare
ReportReport
Posted on by 4
I am trying to create a flow that will store emails in a folder on SharePoint when sent in about a person's account. The issue I am having is having the flow verify if the subfolder exist since it would put the email in the MISCELLANEOUS folder if a folder for that account does not exist yet. As you can see below, the folder path is by Year, Type, the account number with name, and then the COMMUNTICATIONS folder where the email would be stored.
 
 
I have already built the why for the flow to find out the folder for the year but I am stuck on how Power Automate can confirm if there is a folder with the account number and name inside of the Folder A or B. If Power Automate can verify the sub folder, then I would need to have the output to create the path to the folder so I can plug that part in to the reset of the flow to store the email.
Categories:
I have the same question (0)
  • Suggested answer
    chiaraalina Profile Picture
    2,447 Super User 2026 Season 1 on at
     
    Use Get files (properties only) to retrieve the account folders, filter by account number, and use the returned {FullPath} to build the target /COMMUNICATIONS path. If no match is found, route the email to MISCELLANEOUS.
     
    Split email subject:
    If the account number is always the first value in the email subject:
    @{split(triggerOutputs()?['body/subject'],' ')[0]}
     
    Get all folders (and nested)
     
     
    Filter by name 
     
     
    Condition: 
    If true -> 
    first(body('Filter_array'))?['{FullPath}']
     
    You can then create the email file at this path:
    concat(first(body('Filter_array'))?['{FullPath}'],'/COMMUNICATIONS')
     
    Let me know if it worked!
  • ZN-01071546-0 Profile Picture
    4 on at
     
    I tried what you suggested and the Filter array output is not returning anything. I created this test flow as a copy of what you did in your suggestion, Please let me know what you need to help fix the action.
     
    Also, how did you setup the Condition to test true or false?  
     
     
  • ZN-01071546-0 Profile Picture
    4 on at
    Hi @chiaraalina,
     
    I am just sent this message since the last one's @ did not seem to work.
     

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 248 Super User 2026 Season 1

#2
11manish Profile Picture

11manish 204

#3
Haque Profile Picture

Haque 179

Last 30 days Overall leaderboard