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 / Filename not working w...
Power Automate
Answered

Filename not working when copying a file - using Create File action

(0) ShareShare
ReportReport
Posted on by 37

Trying to copy an excel file and give the copy a different (dynamic) file name - every time a form is submitted.  The new file name is a comprised of a combination of fields from the submitted form.   That is, for every form submitted an excel file is created with a filename specific to that submission.

 

A first tried to create the desired file name as a string in flow, but found it easier to instead create a field in the excel table containing the form data (Column=ProposalName;  fx=TEXT([@ID],"00000")&"_"&[@[Sales Person]]&"_"&[@[Client''s Name]]&".xlsx")

 

The flow succeeds, that is it doesn't fail.  However, most times it creates a file name missing all the variables.  As a result, instead of a file that should be called "00006_John_ABCCo.xlsx" it creates "00000__.xlsx". 

 

If I re-test the flow using a recently used trigger, the flow not only succeeds but it gets the name correct this time.   I thought the flow might need a few seconds so I've added delays at different locations with same results.  Seems like the flow can't find the right ID record to locate the field.  I'm using Forms for Excel so the form data (and calculate name field) is being automatically saved to the excel file when form is submitted.

 

Any help is appreciated either fixing this issue... or a finding a way to create the filename using flow (e.g. intialize and create a variable?).

 

BBGG_0-1611187900437.png

 

Categories:
I have the same question (0)
  • Verified answer
    v-yiwenxie-msft Profile Picture
    Microsoft Employee on at

    Hi @BBGG 

     

    If you use the column name as the filename of excel and the column contains expression, then it won’t work.

     

    But you can use the column value in flow and use expressions in ‘compose’ action to get the filename you want.

     

    You could try the flow below:

    1.21-11.PNG

     

    The functions used:

    int(outputs('Get_a_row')?['body/ID'])
    concat(string(outputs('Format_number')?['body']),'_',outputs('Get_a_row')?['body/Sales Person'],'_',outputs('Get_a_row')?['body/Clients'' name'],'.xlsx')

     

    For the string functions used (concat), go to the link: Reference guide for functions in expressions - Azure Logic Apps | Microsoft Docs

    For conversion functions used (int, string), go to the link: Reference guide for functions in expressions - Azure Logic Apps | Microsoft Docs

  • BBGG Profile Picture
    37 on at

    YES!  This worked perfectly.  I knew there'd be a way to do it in flow but couldn't figure it out using stock actions.  This nifty code was just what I needed! Thanks @v-yiwenxie-msft 

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!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 557

#2
Valantis Profile Picture

Valantis 328

#3
David_MA Profile Picture

David_MA 264 Super User 2026 Season 1

Last 30 days Overall leaderboard