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

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / how to get file name a...
Power Automate
Answered

how to get file name and compare it to excel sheet name

(0) ShareShare
ReportReport
Posted on by 17

hi everybody. i am really new to this world. i want to create a flow that when i add a file name to a folder.

it will get the file name, compare the file name to an excel worksheet and check if they match. if they don't, it I will create a new excel sheet by the file name.

Categories:
I have the same question (0)
  • Verified answer
    eric-cheng Profile Picture
    5,171 on at

    Hi @barney1234 ,

     

    Try the below flow.

     

    1) Use a when a file is created in a folder trigger and then get metadata

     

    ericcheng_0-1627908798964.png

    2) Initialize a Boolean variable and set it to @false.  Add a Get worksheets action to get all the worksheets in your Excel

    ericcheng_1-1627908884215.png

    3) Loop through each Excel worksheet and add a condition where Name of worksheet is equal to Name of file (from Get File Metadata).  If found, set Boolean variable to @true

    ericcheng_2-1627908980115.png

     

     

     

     

    4) Exit the loop.  Add another condition to check whether your Boolean is false (i.e. it did not find a worksheet with the same name).  If true, create a worksheet with the name of the file (from Get File Metadata).

    ericcheng_3-1627909076982.png

    ericcheng_4-1627909101467.png

     

     

     

    --------------------------------------------------------------------------
    If I have answered your question, please mark my post as a solution
    If you have found my response helpful, please give it a thumbs up

    Connect on LinkedIn

     

     

     

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…

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
trice602 Profile Picture

trice602 237 Super User 2026 Season 1

#2
David_MA Profile Picture

David_MA 176 Super User 2026 Season 1

#3
Power Platform 1919 Profile Picture

Power Platform 1919 96 Super User 2026 Season 1

Last 30 days Overall leaderboard