Skip to main content

Notifications

Power Automate - General Discussion
Unanswered

how to get the Azure DevOps Connector to return multiple pages when querying users

(0) ShareShare
ReportReport
Posted on by

When using the Azure DevOps Connector in Microsoft flow to query the ADO api users. It only returns 500 users. How can I get it to return the all of the users?

 

flow.JPG

 

I think I need it to pass back in the continuationToken in the header and return the next page of results. but it doesnt give no default way of doing this.

 

Does anyone know how to get the full set of results back? It only returns a subset.

 

Thanks

  • yashag2255 Profile Picture
    yashag2255 24,442 on at
    Re: how to get the Azure DevOps Connector to return multiple pages when querying users

    Hi @Anonymous / @InnComing 

     

    Yes. You can intialize an integer variable and add the number of users in the org to the value of this variable. Now, add a do until action and then set it to run until this variable value is less than 0. 

     

    Intialize another variable to store the continuation string and then check if that string is empty then do send a request without that and once the request is sent, set the variable to that string. when the string has value, send the request with the string to get the next set of users and after this again add the set variable action to set the new continuation string. Remember to add an increment variable action after every http request and select the first variable you initialized and for the increment value type in -500 (as you have confirmed that it returns 500 users. you can also use the length function to check the number of users returned from the previous action and subtract that from the primary variable)

     

    The loop will run until the number of users are returned as specified in the variable. 

     

    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!

  • Re: how to get the Azure DevOps Connector to return multiple pages when querying users

    we have like over 10,000 users. I don't want to run the http action 10 times. Do you know how to do a while loop in power automate? e.g.

    while continuation != 'null' keep returning users until it returns all users. 

     

    many thanks!!

  • yashag2255 Profile Picture
    yashag2255 24,442 on at
    Re: how to get the Azure DevOps Connector to return multiple pages when querying users

    Hi @InnComing 

     

    As per the API documentation, the list users also returns a continuation string that can be passed further in another http action to get the next set of users: https://docs.microsoft.com/en-us/rest/api/azure/devops/graph/users/list?view=azure-devops-rest-5.1

     

    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!

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

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

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

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,495

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,822

Leaderboard