Forum Discussion
Replace text in table
As a newcomer to Power Automate, I require assistance in replacing text within a table and subsequently saving the results to OneDrive.
Source table.
Current steps
Hello jwb3d,
The problem is replace() expects a string, but you're feeding it a table/array, and that's not going to work as-is.
If you just want to swap out every instance of "Record" in the CSV once it's built, do the replace after the Create CSV Table step:
1. replace(outputs('Create_CSV_table'),'Record','342')
2.Then feed that into File Content on the Create file action.
If instead you're trying to change the value in one specific column before the CSV even gets created, you will want a Select action to reshape the array first, then send that into Create CSV table.
Docs: Use data operations
Quick question though, are you trying to replace every "Record" in the whole CSV, or just the one in a particular column?
2 Replies
- Olufemi7Super User
Hello jwb3d,
The problem is replace() expects a string, but you're feeding it a table/array, and that's not going to work as-is.
If you just want to swap out every instance of "Record" in the CSV once it's built, do the replace after the Create CSV Table step:
1. replace(outputs('Create_CSV_table'),'Record','342')
2.Then feed that into File Content on the Create file action.
If instead you're trying to change the value in one specific column before the CSV even gets created, you will want a Select action to reshape the array first, then send that into Create CSV table.
Docs: Use data operations
Quick question though, are you trying to replace every "Record" in the whole CSV, or just the one in a particular column?- jwb3dFrequent Visitor
Thank you for your assistance! The required strings have been successfully replaced. However, the CSV output only displays columns. Please see the sample output below. How can I adjust the formatting to present the output in a table format?
[{"Column1":".." Column3:"0" Column4:"0" Column5:"Replaced on Build"