cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
JoeO
Level: Powered On

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

@1234

UsageType1

UsageType2

@4567

UsageType2

 

  1. FileName: Name2.txt

@1234

UsageType1

 

Flow-CreateListScreenshot.png

2 REPLIES 2
Community Support Team
Community Support Team

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.
JoeO
Level: Powered On

Re: Extract data from SQL and create text file

Hi,

 

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

Announcements
firstImage

Microsoft Flow Online Conference

Join us for a FULL day of FREE Microsoft Flow Sessions from some of the best minds in the industry!

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 Release Wave 2 Plan

Power Platform 2019 Release Wave 2 Plan

Features releasing from October 2019 through March 2020

thirdimage

Flow Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

thirdImage

New Flow Community Board!

Check out the new Microsoft Flow Community Blog Topic Suggestion board!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Flow Community Video Gallery!

Top Kudoed Authors
Users Online
Currently online: 55 members 4,237 guests
Please welcome our newest community members: