web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / How to replace the old...
Power Automate
Unanswered

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,315 Super User 2025 Season 2 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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 538 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 405 Moderator

#3
abm abm Profile Picture

abm abm 252 Most Valuable Professional

Last 30 days Overall leaderboard