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 / How to replace the old...
Power Automate
Suggested Answer

How to replace the old text with New text in Power automate

(1) ShareShare
ReportReport
Posted on by 26
How to replace column headers in CSV file by using replace expression.
 
Here is the replace expression I am using. But not able to see the correct header names in the final output.
 
Attached is the sample replace expression
 
replace(replace(replace(outputs('Compose'),
'Static_DSP_Code','Static DSP Code'),
'Static_DSP_Station','Static DSP Station'),
'Location_Level_1','Location Level 1')
 
When I run the flow this is what I am seeing.
 
But the expected output should be this
 
 
 
I have the same question (0)
  • Suggested answer
    Michael E. Gernaey Profile Picture
    53,960 Moderator on at
    Hi,
     
    Can you please share what you have as the input and output of the Compose from a flow run please, as well as the input and output of Compose 2.
     
    I just put your code below in a hierarchy so I could verify it looks fine to me. I am guessing that the Compose is spitting out a string correct? And that string is all your headers?
     
    P.S. I would simply replace the _, not the whole string, this way you only have to do 1 replace for all of them.
     
    replace(
          replace(
                replace(outputs('Compose'),'Static_DSP_Code','Static DSP Code'),
         'Static_DSP_Station','Static DSP Station'),
    'Location_Level_1','Location Level 1')
     
    replace(Outputs('Compose', '_;, ' ');
     
  • vijaya9090 Profile Picture
    26 on at
    Compose :Inputs contains Body[Export to file Paginated Reports]
    Compose 2: I am replacing the old text with New text
    replace(replace(replace(outputs('Compose'),
    'Static_DSP_Code','Static DSP Code'),
    'Static_DSP_Station','Static DSP Station'),
    'Location_Level_1','Location Level 1')
    Compose 3:Report Name as CSV.
    Create File: File Name:Outputs(Compose3)
    File Content:Outputs(Compose2)
     
    Do you want me to use replace expression as you said in the message
    replace(Outputs('Compose', '_;, ' ');
     
    The replace expression is not clear to me. Can you please send me again the expression that you sent in the other message.
    replace(outputs('Compose','_',,'');.It says invalid expression.
     

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 523

#2
Valantis Profile Picture

Valantis 318

#3
David_MA Profile Picture

David_MA 235 Super User 2026 Season 1

Last 30 days Overall leaderboard