web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / how to use loop to get...
Power Automate
Answered

how to use loop to get my sql server data

(0) ShareShare
ReportReport
Posted on by 267

HI everyone:

    In sql server database , I have a table to record all my employee  data , like I use employeeID can check his manager_id .

    Now , I have to his first manager , second manager , third manage .......etc( some user maybe has 3 level , but some user maybe has 5 level , it will depend on real situation ) .

    So can I use do....until or other method to data what I need 

Categories:
  • yashag2255 Profile Picture
    24,769 Super User 2024 Season 1 on at

    Hi @JACK_LAI_1117 

     

    Can you share the format in which the data of the managers will be returned? You can use the Apply to Each control to loop over each individual record. 

     

    Hope this Helps!

    If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

  • v-alzhan-msft Profile Picture
    Microsoft Employee on at

    Hi @JACK_LAI_1117 ,

     

    I suggest that you could share the example of the table column and data, and explain more details about the requirement so we could better understand you and provide the workaround.

     

    Best Regards,

    Alice

     

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

  • Verified answer
    JACK_LAI_1117 Profile Picture
    267 on at

    @v-alzhan-msft 

     

    @yashag2255 

     

    Finally , I use a stupid method to overcome my problem .

    I ran sql query ten time , every-time the result I put the value to test-array ,then I remove null value in test-array .

     

    Now on , I can use test-array to finish my job ~~~~

     

    Thank you very much ! 

  • v-alzhan-msft Profile Picture
    Microsoft Employee on at

    Hi @JACK_LAI_1117 ,

     

    Glad that the problem is solved.

     

    Best Regards,

    Alice

     

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

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 245 Super User 2026 Season 2

#2
11manish Profile Picture

11manish 233 Super User 2026 Season 2

#3
Valantis Profile Picture

Valantis 136 Super User 2026 Season 2

Last 30 days Overall leaderboard