Skip to main content
Community site session details

Community site session details

Session Id : VWt8JayyHWS0oBcCFqS96q
Power Automate - Building Flows
Answered

Combining txt files into one text file from an Array in Power Automate.

Like (0) ShareShare
ReportReport
Posted on 2 Apr 2024 16:24:18 by 47

Hello!

 

Thank you all so much for reading this!

 

I've struggled with Googling this problem, I don't want to use a 3rd party power automate library to do this.

 

I've noticed that I'm seeing a lot of help for merging into PDF and merging WORD documents on google.

Which is frustrating for me as I only want to combine text files! 

 

I guess because no one uses text files anymore? It shouldn't be too complicated ? I'm overcomplicating this?

 

I have an array within my power automate flow which contains text files like so :

 

array.png

APPEND TO ARRAY VARIABLE

 

NAME : FILE ARRAY

VALIE : {
"source_file_content": @{body('Get_file_content')}
}

 

How can I merge the array text files together and save them as one text file?

 

Many thanks for your help!

  • SuperDude123 Profile Picture
    47 on 03 Apr 2024 at 12:35:52
    Re: Combining txt files into one text file from an Array in Power Automate.

    The above link helped me to solve my problem so I have marked as solution. Hopefully this will help other users. Please go ahead and take time to view the above link.

  • Verified answer
    SuperDude123 Profile Picture
    47 on 03 Apr 2024 at 08:52:39
    Re: Combining txt files into one text file from an Array in Power Automate.

    https://powerusers.microsoft.com/t5/Building-Flows/Combine-CSV-Files-in-SharePoint-Folder-Into-One-Master-File/td-p/1430267

     

    I am currently looking at this to see if it can be adapted to my needs. I think the problem is that when I google for solution, all examples show a fixed array length. As you readers will know already that the array could be of any length depending on the number of files within the sharepoint document folder.

     

    I will experiment with this link above and see if I can make sense of implementing this into a loop.

  • SuperDude123 Profile Picture
    47 on 03 Apr 2024 at 07:18:09
    Re: Combining txt files into one text file from an Array in Power Automate.

    Hello Tomac and thanks for the reply.

    So the files I am merging are in a sharepoint site folder.

    I wish to merge all the text files together in date order. Each file is one month of logs.

    So there will be will be files named as follows.

    2024-01.txt

    2024-02.txt

    2024-03.txt

    I have another document folder in Sharepoint which I will drop the merged file to.

    So far my flow looks like this. I trigger saving the monthly log file via an email. This saves the file to document library in sharepoint.

    Flow1.pngFlow2.png

  • Tomac Profile Picture
    1,275 Moderator on 02 Apr 2024 at 18:26:04
    Re: Combining txt files into one text file from an Array in Power Automate.

    Hi! I need a bit more information about your goal to assist. Are you looking to store the text file in SharePoint/OneDrive or are you looking to have a single array with the text files for use in your Flow?

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

Announcing our 2025 Season 2 Super Users!

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

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Tomac Profile Picture

Tomac 986 Moderator

#2
stampcoin Profile Picture

stampcoin 699 Super User 2025 Season 2

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 577 Super User 2025 Season 2

Loading complete