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
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,425 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!

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 Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Valantis Profile Picture

Valantis 377

#2
11manish Profile Picture

11manish 279

#3
David_MA Profile Picture

David_MA 234 Super User 2026 Season 1

Last 30 days Overall leaderboard