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 / Power Automate FIle Na...
Power Automate
Answered

Power Automate FIle Name Extract

(0) ShareShare
ReportReport
Posted on by 74

Hello, 

I am a new PAD user. I am trying to build a flow that will extract first 5 character of the file name from a folder and then match the 5 char with an excel file column a and if finds match it will rename it using column c. But I am having trouble make it to work. 

rrahat93_0-1715868996585.png

I also tried this

rrahat93_1-1715869111838.png

for some reason %TextList[0]% is not doing anything. Can someone please help

I have the same question (0)
  • Deenuji_Loganathan_ Profile Picture
    6,250 Moderator on at

    @rrahat93 

     

    You have created your desktop flow with power fx enabled features since it's in-preview stage and it have lot of limitations as well.

     

    Please find the below known limitations for power fx enabled flow.

     

    Deenuji_0-1715870602336.png

     

    Please replicate your desktop flow by deactivating that option as shown below, and implement similar logic, it should work properly

    Deenuji_1-1715870745472.png

    .

     

    In case if you want to continue with power fx enabled flow with known limitations then use the below syntax:

     

    Index starts from 1 in power fx 

    Deenuji_0-1715871084727.png

     

     

     

     

    Thanks,
    Deenuji Loganathan 👩‍💻
    Automation Evangelist 🤖
    Follow me on LinkedIn 👥

    -------------------------------------------------------------------------------------------------------------
    If I've helped solve your query, kindly mark my response as the solution ✔ and give it a thumbs up!👍 Your feedback supports future seekers 🚀

     

  • RR-05041550-0 Profile Picture
    74 on at

    @Deenuji  if i change I disable power FX, do you think my flow will work?

  • Deenuji_Loganathan_ Profile Picture
    6,250 Moderator on at

    @rrahat93 

     

    In case if you want to continue with power fx enabled flow with known limitations then use the below syntax:

     

    Index starts from 1 in power fx 

    Deenuji_0-1715871232810.png

     

     


    Thanks,
    Deenuji Loganathan 👩‍💻
    Automation Evangelist 🤖
    Follow me on LinkedIn 👥

    -------------------------------------------------------------------------------------------------------------
    If I've helped solve your query, kindly mark my response as the solution ✔ and give it a thumbs up!👍 Your feedback supports future seekers 🚀

  • RR-05041550-0 Profile Picture
    74 on at

    I rebuilt it and disabled power fx. but file name are not changing. 

    rrahat93_0-1715871572051.png

    my file name is in this format 00023_2024-MAR-U002K3Q4

  • VishnuReddy1997 Profile Picture
    2,656 Super User 2026 Season 1 on at

    Hi @rrahat93 ,

     

    Please find the solution. Please Disable the Power FX option before creating the flow.

    VishnuReddy1997_0-1715871594997.png

     

    VishnuReddy1997_1-1715871659330.png

     

    Code:

     

    System.TerminateProcess.TerminateProcessByName ProcessName: $'''EXCEL'''
    Folder.GetFiles Folder: $'''C:\\Users\\OneDrive\\Desktop\\Power Automate Desktop\\Practice\\Excel\\Excel Input''' FileFilter: $'''*''' IncludeSubfolders: False FailOnAccessDenied: True SortBy1: Folder.SortBy.NoSort SortDescending1: False SortBy2: Folder.SortBy.NoSort SortDescending2: False SortBy3: Folder.SortBy.NoSort SortDescending3: False Files=> Files
    LOOP FOREACH CurrentItem IN Files
     Excel.LaunchExcel.LaunchAndOpenUnderExistingProcess Path: CurrentItem.FullName Visible: True ReadOnly: False Instance=> ExcelInstance
     Excel.ReadFromExcel.ReadCell Instance: ExcelInstance StartColumn: $'''A''' StartRow: 1 ReadAsText: False CellValue=> A_ColumValue
     Excel.ReadFromExcel.ReadCell Instance: ExcelInstance StartColumn: $'''C''' StartRow: 1 ReadAsText: False CellValue=> C_ColumnValue
     Excel.CloseExcel.Close Instance: ExcelInstance
     SET FileName TO CurrentItem.NameWithoutExtension
     Text.SplitText.SplitAtNumberOfCharacters Text: FileName SplitInterval: 5 Result=> Five_FileName
     SET First_Five_FileName TO Five_FileName[0]
     Text.Trim Text: First_Five_FileName TrimOption: Text.TrimOption.Both TrimmedText=> First_Five_FileName
     IF First_Five_FileName = A_ColumValue THEN
     File.RenameFiles.Rename Files: CurrentItem.FullName NewName: C_ColumnValue KeepExtension: True IfFileExists: File.IfExists.DoNothing RenamedFiles=> RenamedFiles
     END
    END

     

     

    (Note:- if you got your solution you can mark as solution and gives kudos)


    Thanks & Regards

    Vishnu Reddy

  • Deenuji_Loganathan_ Profile Picture
    6,250 Moderator on at

    @rrahat93 

     

    How is your folder files and excel files looks like?

     

    Share some screenshot on the same.

     

     

  • RR-05041550-0 Profile Picture
    74 on at

    NewVar Variable is giving this 

    rrahat93_2-1715871812501.png

     

  • RR-05041550-0 Profile Picture
    74 on at

    @Deenuji 

    rrahat93_1-1715871959323.png

     

  • VishnuReddy1997 Profile Picture
    2,656 Super User 2026 Season 1 on at

    Hi @rrahat93 ,

     

    Try My solution and let me know.

     

    Regards,

    Vishnu Reddy

  • Deenuji_Loganathan_ Profile Picture
    6,250 Moderator on at

    @rrahat93 

     

    Do you intend to truncate the filename obtained from the folder, verify if the truncated filename exists in column A, and if there's a match, extract the corresponding name from column C to rename your file accordingly? Is this the workflow you wish to create?

     


    Thanks,
    Deenuji Loganathan 👩‍💻
    Automation Evangelist 🤖
    Follow me on LinkedIn 👥

    -------------------------------------------------------------------------------------------------------------
    If I've helped solve your query, kindly mark my response as the solution ✔ and give it a thumbs up!👍 Your feedback supports future seekers 🚀

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 592

#2
Valantis Profile Picture

Valantis 340

#3
11manish Profile Picture

11manish 284

Last 30 days Overall leaderboard