Skip to content

Instantly share code, notes, and snippets.

@pkskelly
Last active April 23, 2020 01:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pkskelly/f02eab1f230293ef8ff3d20c5e02a697 to your computer and use it in GitHub Desktop.
Save pkskelly/f02eab1f230293ef8ff3d20c5e02a697 to your computer and use it in GitHub Desktop.
Merge jq module to merge MS Flow JSON output with Azure AD user information
# Create a dictionary based on the $owner.id property from the owners array parameter
($owners | map(select(.id != null)) | map( {(.id): {displayName, userPrincipalName, mail}}) | add) as $dict
# Output each flow and append the the owner information from each dictionary entry
# using the flow's creator.userId property as the key
| $flows |.[].properties.creator |= . + $dict[.userId]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment