In Power Automate (previously Microsoft Flow) you cannot use inline javascript directly - there is some limited Javascript-like coding, but itâs not very useful here.
Logic Apps and I believe Power Apps (also based on the Power Platform) can run JavaScript I believe.
However, not all is lost, with some creative JSON Scheme-a-ing and some data operations, I could get Automate so that it would parse out the Userâs ID and Display Name.
The whole process is explained below, and itâs a bit of a doozy, but the code is provided
NOTE: This is highly dependent on Syncro not changing the way that this returns, and currently there is not a defined Schema for this method for us to trust it will return as. But if we ASSUME that the first item inside of a user is always the UserID and the Second item is always their DisplayName, we can just parse it through as such
First - I parse a response from the Syncro API with the first JSON Schema I made
This will
- validate the JSON Matches the schema (to make certain you donât treat uncorrected JSON like corrected ones)
- recognize the Body (the entire value input/validated)
- Recognize âAllUsersâ (the array of all unmodified user objects)
- Recognize "UserFields (Each array of items within each item in âAllUsersâ)
From that, we take the AllUsers array of user objects and map it to Property Names in an object.
Each input looks like this
[
134465,
"John Hancock"
]
Now, unfortunately I couldnât see an easy to use the UserFields I made before, because it would iterate through each field for each user and it was too deep.
So we have to use a function to recognize this object INSIDE of the current item as an array, and then get the First or Last Item
The mapping looks like this

and those expressions are first(array(item()))
and last(array(item()))
Respectively.
Functionally, this takes the Object from being an
- Array of (
- Arrays of (
- both of (
- integers and
- strings
)
)
)
to
- Array of (
- Objects with(
- Property 'UserID" - Type Integer
- Property 'Displayname - Type String
)
)
)
that change looks like this
NOTE: This is the part that - based on current API Docs - may not be relied upon to always be the same order or could be changed later - You could add some additional error-checking and make sure the first item was an integer, etc - but that seems like unneeded extra work until it becomes a problem
Next, we have Values, but they are not parsed into nice-to use âdynamic contentâ.
Without the dynamic Content - we would have to make references like body('ParseJSON-ParseProperties')['Users']?['DisplayName']
- and it would not be able to handle any action names being changed
So we run it through a new âParse JSONâ action with a slightly difference Schema to pull out the helpful items in the JSON
This takes the âDynamic Contentâ options from this

to this

Note: The schema is constructed in such a way that if you tried to pass an unmodified Syncro /Users result to the later Schema - it will error, and if you try to pass the modified JSON to the earlier Schema, it will also error. This is intentional so that you canât accidentally try to use a modified json as an unmodified one and vice-versa.
From here, you are good to put any output data you want, or take actions, or whatever you would like.
You could make a text body to output to an email


Or Select a certain user to get their ID number and further query something else
I will get a link to Example code and/or github and/or deploy button here in a little bit
Exporting/Importing flows is always this annoying ZIP format that is odd but you should be able to go to Flow > Manage > Import and import the ZIP without much trouble