0

I am working on a logic app that will create users in third party applications based on AAD group membership. To avoid issues when the group has more than 999 users I have implemented paging. I first get the first 50 users, and a NextLink that I call to get the next 50. This loop runs fine. Snippet of logic app

When no more nextlink is found, the loop exits. During the loop iterations, I need to store the user information (first name, lastname, UPN etc) in an array so i can process everyone after running through the loop. I have tried running the Union expression as follows: union(variables('AllUserInfoArray'),body('HTTP_-_Request_My_Group_Name_group_members')['value']) But this does not add the user data to the AllUserInfoArray, it creates a new array (Compose->Outputs). How do I add all userdata into the AllUserInfoArray array so I can loop through all users once all user info has been gathered?

Martijn Balink
  • 35
  • 1
  • 1
  • 5

1 Answers1

0

According to the description of your problem, your concern is the "union" in "Compose" action creates a new array which contains both of the collections(array) but why not append the array from http request to the array "AllUserInfoArray". But why not create an action after the "Compose" to set the variable "AllUserInfoArray" with output value of the "Compose". And then we can do the union again to modify "AllUserInfoArray" in the next loop. enter image description here

Hury Shen
  • 14,948
  • 1
  • 9
  • 18
  • Of course! Simply assigning the output of the Compose/Union Output to the AllUserInfoArray variable solved my problem. After looping through the group members, this array now contains all information I need. Thanks! – Martijn Balink Dec 02 '19 at 13:26