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 / Append Text to File Na...
Power Automate
Answered

Append Text to File Name in Save As box

(0) ShareShare
ReportReport
Posted on by 53

Hi,

 

Wondering if there's a way to append text to file name when saving a file in Save As box. Whenever I append text to the original file name using Desktop Automate, it just takes that whole file name and inserts it the same way to any future files being downloaded. Any way to just add a string to the original file name?

I have the same question (0)
  • Slavnyy_Avtomat Profile Picture
    108 on at

    If you're working in what's primarily a web workflow, you should try adding the UI element.  Most 'Save As' boxes are listed as a Combo box.

    Once you've got the UI element, you can use the Populate text field in window option. See below:

    Slavnyy_Avtomat_0-1637262365722.png


    To answer your question specifically, you could store the base version of your file name as a variable, let's say %YourFile%, then populate the save as field with that variable + whatever you'd like to append:

    %YourFile%whatever.other.things.you.want.to.append  -- does that make sense?

  • Peter13 Profile Picture
    53 on at

    So would this allow for a dynamic file name each time it's downloaded? From what I understand this: %YourFile%whatever.other.things.you.want.to.append would keep it the same file name every time, which I want to avoid. Maybe I'm missing it.

    Also, any way to populate a dynamic date into the file name? Let's say, next coming Friday from each download date. So if file was downloaded any day this week, 11.19.21 would be placed into the file name.

  • MichaelAnnis Profile Picture
    5,727 Moderator on at

    Yes, you can enter variables anywhere you want in the text, so:

    %YourFile%_%Whatyouwanttoappend% would also work.  Where %YourFile% is "Final" and %Whatyouwanttoappend% is "Product", written that way would be "Final_Product"

  • Peter13 Profile Picture
    53 on at

    Thank you, Michael. That works pretty well. Would you be able to help me with an expression to fill in date of last Friday? So for example, if I ran the flow today, it would enter 11.12.21 into file name.

  • VJR Profile Picture
    7,635 on at

    @Peter13 

    To keep you moving can you give some clarity on what is written in the post.

    You mentioned if the flow is run today it should show date of Last Friday. But 11.12.21 is not Friday. So a bit confused here.

  • MichaelAnnis Profile Picture
    5,727 Moderator on at

    11/12/21 MM/dd/yy is a Friday; sorry for the confusion there @VJR .  Here is the logic, I am not at my computer to show you:

     

    Get CurrentDateTime

    Set variable %KnownFriday% to 11/5/21 (may have to convert this to date if it doesn’t default to a date variable type. 

    Subtract Dates %CurrentDateTime% - %KnownFriday% to %DateDifference%
    Set %weeks% to %DateDifference / 7% (this will give us the number of weeks with decimal ex for 11/18/21 would be 1.87…)

    Truncate number %weeks% (this will remove decimals Ex. 1) to %WeeksTruncated%

    Add To Date %KnownFriday% Days %WeeksTruncated * 7% (this will add, in our example, 7 days to the known Friday, or 11/12/21)

    Lastly, you’ll want to ‘Convert Date to text’ in whatever custom format you want. Be sure to use capital Ms for the month (ex. MMddyyyy).

     

    Whatever that converted variable is in ‘Convert Date to text’ is the one you can put in your file name. 

     

  • VJR Profile Picture
    7,635 on at

    This is causing the confusion to me at least 🙂

     

    Below lines taken from above posts...

     

    - So if file was downloaded any day this week, 11.19.21 would be placed into the file name.

    - So for example, if I ran the flow today, it would enter 11.12.21 into file name.

  • Peter13 Profile Picture
    53 on at

    Hi VJR,

     

    Let me clarify. I'm using Power Automate to pull a file from a web page every week. The file name is random and does not provide any information to better identify it. Michael helped me with inserting a Company ID in the file name when saving and I also want to add a Statement Date to it. The Statement Date is always a Friday while the statement comes out Tuesday night following a Friday. Taking this week as an example, last week a Friday was 11.12.21 and I would run the flow anytime between Tuesday night of 11.16 to Thursday 11.18. So when a file is downloaded between the dates just mentioned, the expression would return the same settlement date into the file name of 11.12.21. Hope this clarifies.

  • Verified answer
    MichaelAnnis Profile Picture
    5,727 Moderator on at

    Here is the more official version of the logic I pasted below.  You can copy the text below the screenshot and should be able to paste it right into a subflow.

     

    MichaelAnnis_3-1637336210228.png

     

    DateTime.Local DateTimeFormat: DateTime.DateTimeFormat.DateOnly CurrentDateTime=> CurrentDateTime4
    SET KnownFriday TO $'''11/05/2021'''
    DateTime.Subtract FromDate: CurrentDateTime4 SubstractDate: KnownFriday TimeUnit: DateTime.DifferenceTimeUnit.Days TimeDifference=> DateDifference
    SET Weeks TO DateDifference / 7
    Variables.GetIntegerPart Number: Weeks Result=> WeeksTruncated
    DateTime.Add DateTime: KnownFriday TimeToAdd: WeeksTruncated * 7 TimeUnit: DateTime.TimeUnit.Days ResultedDate=> ResultedDate
    Text.FromCustomDateTime DateTime: ResultedDate CustomFormat: $'''MMddyyyy''' Result=> FormattedDateTime4
    Display.ShowMessage Title: $'''Result''' Message: FormattedDateTime4 Icon: Display.Icon.None Buttons: Display.Buttons.OK DefaultButton: Display.DefaultButton.Button1 IsTopMost: False ButtonPressed=> ButtonPressed6

     

     

  • Peter13 Profile Picture
    53 on at

    Hi Michael,

     

    Thank you for providing the steps. There's a lot going on there and I just want to make sure I understand all the components.

     

    1) DateTime.Local DateTimeFormat: DateTime.DateTimeFormat.DateOnly CurrentDateTime=> CurrentDateTime4 (is CurrentDateTime4 a variable that needs to be created? And is the value everything up to and including "=>"?)

     

    2) SET KnownFriday TO $'''11/05/2021''' (so the value would be "$"'11/05/2021'"?)
    3) DateTime.Subtract FromDate: CurrentDateTime4 SubstractDate: KnownFriday TimeUnit: DateTime.DifferenceTimeUnit.Days TimeDifference=> DateDifference (this is variable DateDifference with value of everything and including =>?)
    SET Weeks TO DateDifference / 7
    Variables.GetIntegerPart Number: Weeks Result=> WeeksTruncated
    DateTime.Add DateTime: KnownFriday TimeToAdd: WeeksTruncated * 7 TimeUnit: DateTime.TimeUnit.Days ResultedDate=> ResultedDate
    Text.FromCustomDateTime DateTime: ResultedDate CustomFormat: $'''MMddyyyy''' Result=> FormattedDateTime4
    Display.ShowMessage Title: $'''Result''' Message: FormattedDateTime4 Icon: Display.Icon.None Buttons: Display.Buttons.OK DefaultButton: Display.DefaultButton.Button1 IsTopMost: False ButtonPressed=> ButtonPressed6

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 April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 997

#2
Valantis Profile Picture

Valantis 810

#3
Haque Profile Picture

Haque 642

Last 30 days Overall leaderboard