Showing results for 
Search instead for 
Did you mean: 
Helper II
Helper II

Extract data from SQL and create text file

I’ve been trying to figure out how to achieve this using Flow, but im drawing a blank. Here’s my story, and refer to the screenshot below.


I have 4 SQL tables containing info. Three of them contain their own info, and a 4th which links the other 3. Its actually a dynamics crm database, and by links I mean relationships, but its all the same. Im looking to generate a text file output in a specific format using info from all 4 tables. For example, say I have the following tables.


  1. Table1 – ColumnB
    1. 1234
    2. 4567
  2. Table2 – ColumnB
    1. Name1
    2. Name2
  3. Table3 – ColumnB
    1. UsageType1
    2. UsageType2
  4. Table4 (linking the above 3 tables) – ColumnB – ColumnC – ColumnD
    1. 1234 – Name1 – UsageType1
    2. 4567 – Name1 – UsageType2
    3. 1234 – Name2 – UsageType1
    4. 1234 – Name1 – UsageType2
    5. Or any other combination.


I now wish to generate the following text files:

  1. FileName: Name1.txt







  1. FileName: Name2.txt





Community Support
Community Support

Re: Extract data from SQL and create text file

Hi @JoeO ,


Although you have provided a lot of information, I still don't understand whether the files you create have any rules.

Please provide more detail about your needs.


Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Helper II
Helper II

Re: Extract data from SQL and create text file



If by "rule" you're referring to the rule table in my example, the answer is no. The rule becomes the name of the text file.  So for example, say i have a row in Table2 called "Test", then the file name becomes Test.txt. 

Helpful resources

Community Conference

Power Platform Community Conference

Come join us today! Find your favorite faces from the community presenting at the Power Platform Community Conference!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

Upcoming Events

Experience what’s next for Power Automate

See the latest Power Automate innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Top Solution Authors
Top Kudoed Authors
Users online (3,565)