Azure Logic App - Foreach over sql resultset









up vote
0
down vote

favorite












I'm using an Execute Sql Query action in logic app.
Returned result is composed of 1..n tables ("selects").
I want to create a csv table and send it over tfs.



The issue I'm having is that the tables are elements of resultset, and not part of an array.



Is there some way to perform ForEach action on the resultset elements (i.e. - 'Table1', 'Table2', etc...)?










share|improve this question

















  • 1




    If possible, please add the resultset format in the question. Json ,XML or others? If there is sample data will be helpful.
    – Tom Sun
    Nov 14 at 9:48











  • "ResultSets": "Table1": [ A UnitData... , B UnitData... , ... ] "Table2": [ X UnitData... , Y UnitData... , ... ]
    – Dani T
    Nov 18 at 7:06











  • This is the output of the SQL query, that divides the results to 1000 rows on each table, each unit data element is a returned row, all tables have same elements structure.
    – Dani T
    Nov 18 at 7:07














up vote
0
down vote

favorite












I'm using an Execute Sql Query action in logic app.
Returned result is composed of 1..n tables ("selects").
I want to create a csv table and send it over tfs.



The issue I'm having is that the tables are elements of resultset, and not part of an array.



Is there some way to perform ForEach action on the resultset elements (i.e. - 'Table1', 'Table2', etc...)?










share|improve this question

















  • 1




    If possible, please add the resultset format in the question. Json ,XML or others? If there is sample data will be helpful.
    – Tom Sun
    Nov 14 at 9:48











  • "ResultSets": "Table1": [ A UnitData... , B UnitData... , ... ] "Table2": [ X UnitData... , Y UnitData... , ... ]
    – Dani T
    Nov 18 at 7:06











  • This is the output of the SQL query, that divides the results to 1000 rows on each table, each unit data element is a returned row, all tables have same elements structure.
    – Dani T
    Nov 18 at 7:07












up vote
0
down vote

favorite









up vote
0
down vote

favorite











I'm using an Execute Sql Query action in logic app.
Returned result is composed of 1..n tables ("selects").
I want to create a csv table and send it over tfs.



The issue I'm having is that the tables are elements of resultset, and not part of an array.



Is there some way to perform ForEach action on the resultset elements (i.e. - 'Table1', 'Table2', etc...)?










share|improve this question













I'm using an Execute Sql Query action in logic app.
Returned result is composed of 1..n tables ("selects").
I want to create a csv table and send it over tfs.



The issue I'm having is that the tables are elements of resultset, and not part of an array.



Is there some way to perform ForEach action on the resultset elements (i.e. - 'Table1', 'Table2', etc...)?







azure azure-logic-apps






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 11 at 9:48









Dani T

183




183







  • 1




    If possible, please add the resultset format in the question. Json ,XML or others? If there is sample data will be helpful.
    – Tom Sun
    Nov 14 at 9:48











  • "ResultSets": "Table1": [ A UnitData... , B UnitData... , ... ] "Table2": [ X UnitData... , Y UnitData... , ... ]
    – Dani T
    Nov 18 at 7:06











  • This is the output of the SQL query, that divides the results to 1000 rows on each table, each unit data element is a returned row, all tables have same elements structure.
    – Dani T
    Nov 18 at 7:07












  • 1




    If possible, please add the resultset format in the question. Json ,XML or others? If there is sample data will be helpful.
    – Tom Sun
    Nov 14 at 9:48











  • "ResultSets": "Table1": [ A UnitData... , B UnitData... , ... ] "Table2": [ X UnitData... , Y UnitData... , ... ]
    – Dani T
    Nov 18 at 7:06











  • This is the output of the SQL query, that divides the results to 1000 rows on each table, each unit data element is a returned row, all tables have same elements structure.
    – Dani T
    Nov 18 at 7:07







1




1




If possible, please add the resultset format in the question. Json ,XML or others? If there is sample data will be helpful.
– Tom Sun
Nov 14 at 9:48





If possible, please add the resultset format in the question. Json ,XML or others? If there is sample data will be helpful.
– Tom Sun
Nov 14 at 9:48













"ResultSets": "Table1": [ A UnitData... , B UnitData... , ... ] "Table2": [ X UnitData... , Y UnitData... , ... ]
– Dani T
Nov 18 at 7:06





"ResultSets": "Table1": [ A UnitData... , B UnitData... , ... ] "Table2": [ X UnitData... , Y UnitData... , ... ]
– Dani T
Nov 18 at 7:06













This is the output of the SQL query, that divides the results to 1000 rows on each table, each unit data element is a returned row, all tables have same elements structure.
– Dani T
Nov 18 at 7:07




This is the output of the SQL query, that divides the results to 1000 rows on each table, each unit data element is a returned row, all tables have same elements structure.
– Dani T
Nov 18 at 7:07












2 Answers
2






active

oldest

votes

















up vote
1
down vote



accepted











Is there some way to perform ForEach action on the resultset elements (i.e. - 'Table1', 'Table2', etc...)?'




According to the mentioned data format, it seems that it is not supported via foreach action in logic app.



If Azure function is acceptable, I recommend that you could use the Azure function to implement it with your customized logic to deal with data.






share|improve this answer




















  • No way that I have seen to do a foreach loop on these elements... Seems like going to an Azure Function will be the answer in this case... Thanks!
    – Dani T
    Nov 22 at 5:32


















up vote
0
down vote













Foreach on a Resultset will return JSON object of each row.
I couldn't find any option DesignView to extract the value but you can achieve same in CodeView by assigning following code to your variable in CodeView.



In below MEETINGID is my column name.



"@items('For_each')?['MEETINGID']"
"imeetingid": "@items('For_each')?['MEETINGID']"






share|improve this answer




















    Your Answer






    StackExchange.ifUsing("editor", function ()
    StackExchange.using("externalEditor", function ()
    StackExchange.using("snippets", function ()
    StackExchange.snippets.init();
    );
    );
    , "code-snippets");

    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "1"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53247510%2fazure-logic-app-foreach-over-sql-resultset%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    1
    down vote



    accepted











    Is there some way to perform ForEach action on the resultset elements (i.e. - 'Table1', 'Table2', etc...)?'




    According to the mentioned data format, it seems that it is not supported via foreach action in logic app.



    If Azure function is acceptable, I recommend that you could use the Azure function to implement it with your customized logic to deal with data.






    share|improve this answer




















    • No way that I have seen to do a foreach loop on these elements... Seems like going to an Azure Function will be the answer in this case... Thanks!
      – Dani T
      Nov 22 at 5:32















    up vote
    1
    down vote



    accepted











    Is there some way to perform ForEach action on the resultset elements (i.e. - 'Table1', 'Table2', etc...)?'




    According to the mentioned data format, it seems that it is not supported via foreach action in logic app.



    If Azure function is acceptable, I recommend that you could use the Azure function to implement it with your customized logic to deal with data.






    share|improve this answer




















    • No way that I have seen to do a foreach loop on these elements... Seems like going to an Azure Function will be the answer in this case... Thanks!
      – Dani T
      Nov 22 at 5:32













    up vote
    1
    down vote



    accepted







    up vote
    1
    down vote



    accepted







    Is there some way to perform ForEach action on the resultset elements (i.e. - 'Table1', 'Table2', etc...)?'




    According to the mentioned data format, it seems that it is not supported via foreach action in logic app.



    If Azure function is acceptable, I recommend that you could use the Azure function to implement it with your customized logic to deal with data.






    share|improve this answer













    Is there some way to perform ForEach action on the resultset elements (i.e. - 'Table1', 'Table2', etc...)?'




    According to the mentioned data format, it seems that it is not supported via foreach action in logic app.



    If Azure function is acceptable, I recommend that you could use the Azure function to implement it with your customized logic to deal with data.







    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered Nov 20 at 9:45









    Tom Sun

    15.9k2921




    15.9k2921











    • No way that I have seen to do a foreach loop on these elements... Seems like going to an Azure Function will be the answer in this case... Thanks!
      – Dani T
      Nov 22 at 5:32

















    • No way that I have seen to do a foreach loop on these elements... Seems like going to an Azure Function will be the answer in this case... Thanks!
      – Dani T
      Nov 22 at 5:32
















    No way that I have seen to do a foreach loop on these elements... Seems like going to an Azure Function will be the answer in this case... Thanks!
    – Dani T
    Nov 22 at 5:32





    No way that I have seen to do a foreach loop on these elements... Seems like going to an Azure Function will be the answer in this case... Thanks!
    – Dani T
    Nov 22 at 5:32













    up vote
    0
    down vote













    Foreach on a Resultset will return JSON object of each row.
    I couldn't find any option DesignView to extract the value but you can achieve same in CodeView by assigning following code to your variable in CodeView.



    In below MEETINGID is my column name.



    "@items('For_each')?['MEETINGID']"
    "imeetingid": "@items('For_each')?['MEETINGID']"






    share|improve this answer
























      up vote
      0
      down vote













      Foreach on a Resultset will return JSON object of each row.
      I couldn't find any option DesignView to extract the value but you can achieve same in CodeView by assigning following code to your variable in CodeView.



      In below MEETINGID is my column name.



      "@items('For_each')?['MEETINGID']"
      "imeetingid": "@items('For_each')?['MEETINGID']"






      share|improve this answer






















        up vote
        0
        down vote










        up vote
        0
        down vote









        Foreach on a Resultset will return JSON object of each row.
        I couldn't find any option DesignView to extract the value but you can achieve same in CodeView by assigning following code to your variable in CodeView.



        In below MEETINGID is my column name.



        "@items('For_each')?['MEETINGID']"
        "imeetingid": "@items('For_each')?['MEETINGID']"






        share|improve this answer












        Foreach on a Resultset will return JSON object of each row.
        I couldn't find any option DesignView to extract the value but you can achieve same in CodeView by assigning following code to your variable in CodeView.



        In below MEETINGID is my column name.



        "@items('For_each')?['MEETINGID']"
        "imeetingid": "@items('For_each')?['MEETINGID']"







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 25 at 13:33









        Mahesh B

        39110




        39110



























            draft saved

            draft discarded
















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.





            Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


            Please pay close attention to the following guidance:


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53247510%2fazure-logic-app-foreach-over-sql-resultset%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Top Tejano songwriter Luis Silva dead of heart attack at 64

            政党

            天津地下鉄3号線