Skip to main content

Notifications

Power Automate - General Discussion
Unanswered

Take my Input file name and add _Output and give it as the name of the outfut file

(0) ShareShare
ReportReport
Posted on by 31

Hi,

 

I have a csv file, names xyz.csv. I have made my modifications to the csv and generated the output file (csv) saved in OneDrive. That output file should be named cyz_Output.csv. How can I do that?

 

Thanks,

  • ricpower00 Profile Picture
    ricpower00 42 on at
    Re: Take my Input file name and add _Output and give it as the name of the outfut file

    Sure lets assume your source file and output file are in different folders in OneDrive.

     

    You can get the source file name by using list file in onedrive action. Use a compose action to extract the name. The expression will be something similar to the below:
    substring(outputs('List_files_in_folder')?['body/value']?[0]['Name'], 0, indexOf(outputs('List_files_in_folder')?['body/value']?[0]['Name'], '.csv'))

     

    You can pass that in when creating your output file.

    ricpower00_0-1717116382301.png

     

  • DryMouse555 Profile Picture
    DryMouse555 31 on at
    Re: Take my Input file name and add _Output and give it as the name of the outfut file

    Hi, thanks for the reply. Can you please guide me on  how to do that? Very much appreciate your help.

  • ricpower00 Profile Picture
    ricpower00 42 on at
    Re: Take my Input file name and add _Output and give it as the name of the outfut file

    Is your source file in OneDrive as well? You can extract your source file name and pass in through as dynamic contents when setting the new file name.

  • DryMouse555 Profile Picture
    DryMouse555 31 on at
    Re: Take my Input file name and add _Output and give it as the name of the outfut file

    Yes, but I want to automatically get the input file name followed by output. I don't want to do this every time I run the flow. It should do it automatically. 

  • ricpower00 Profile Picture
    ricpower00 42 on at
    Re: Take my Input file name and add _Output and give it as the name of the outfut file

    Not sure if I understand your question correctly but you can name your file as you want, when you use the create a file in onedrive action.

    ricpower00_1-1717032351495.png

     

     

  • creativeopinion Profile Picture
    creativeopinion 10,064 on at
    Re: Take my Input file name and add _Output and give it as the name of the outfut file

    @DryMouse555 You'll need to use an expression to do this. Check out this section of my latest YT Tutorial: 

     7 Functions You Need to Know | ️Expression Essentials: Part 1

     

    In this section, I show a flow that takes attachments received from specific emails and saves them to a specific folder on SharePoint. The flow checks to see if a file with the same name already exists, if so—it’ll append a timestamp to the filename. You can use the same concepts covered in this tutorial and apply them to your flow.

     

    In the full tutorial I cover 7 functions you need to know when getting started with expressions.

    1️⃣ empty()

    2️⃣ coalesce()

    3️⃣ equals()

    4️⃣ if()

    5️⃣ concat()

    6️⃣ length()

    7️⃣ split()

     

    I cover how to use these functions in expressions and I’ll also cover common mistakes when it comes to writing expressions and show you a few tips and tricks along the way.

     

    As a beginner or even an intermediate flow builder—expressions can seem a bit complex at first, I’m going to try to simplify it for you. If you want to level up your flows by writing expressions—keep watching!

     

    IN THIS VIDEO:

     What is an Expression?

     What is a Function?

     What Does Wrapping a Function Mean?

     How Do I Insert an Expression?

     How to Use a Compose action

     How to Navigate the Expression Builder with Arrow Keys

     How to use the Expression Tooltip

     Common Mistakes When Writing Expressions

     How to differentiate a null from an empty string

     How to Get Dynamic Content When it’s Not Listed

     How to Use a Get Item Action to Verify Dynamic Content Output

     How to Convert Strings to Lower Case

     How to Troubleshoot the if() Function

     

    Hope this helps!

    If I helped you solve your problem—please mark my post as a solution .
    Consider giving me a 👍 if you liked my response!

    👉 Level up your Power Automate skills by checking out my tutorials on YouTube
    👉 Tips and Tricks on TikTok and Instagram

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

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,475

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,767

Leaderboard