AnsweredAssumed Answered

Parsing JSON returned from Query List

Question asked by synergyjk1 on Jan 11, 2017
Latest reply on Feb 10, 2017 by tposzytek

Hi,

 

What I want to do

  1. Query another list in the same site
  2. Get all the users in a single people or group field, get the email addresses of those users
  3. Save the email addresses in a string separated by a delimiter.
  4. Append another email address to the above string
  5. Save the string of email addresses to another people or group field in the same list (on which the workflow is running on)

 

What I am able to do

1. Query another list in the same site using Query list action

2. Get a list of email addresses in the people or group field. What I get is JSON

[{"Pool_x0020_Access_x0020_Users":[{"EMail":"Jake.Barton@email.com"},{"EMail":"Juan.AlonsoColmenares@email.com"},{"EMail":"B.Michels@email.com"},{"EMail":"Heather.Mellion@email.com"}]}]  

3. Get the first item from the above collection which returns a dictionary

{"Pool_x0020_Access_x0020_Users":[{"EMail":"Jake.Barton@email.com"},{"EMail":"Juan.AlonsoColmenares@email.com"},{"EMail":"B.Michels@email.com"},{"EMail":"Heather.Mellion@email.com"}]}

 

What I am not able to do

Get the email addresses in the dictionary into a string separated by a delimiter

 

I have a Query list action not Office 365 Query list action but a simple Query list action that gets data from the same site in a different list. The field I select is a people or group field which only returns people information. In my action the with property is set to work email and this is the JSON I get

 

[{"Pool_x0020_Access_x0020_Users":[{"EMail":"Jake.Barton@email.com"},{"EMail":"Juan.AlonsoColmenares@email.com"},{"EMail":"B.Michels@email.com"},{"EMail":"Heather.Mellion@email.com"}]}]        

 

From what I can tell

1. I have a collection

2. In the first index of the collection I have a dictionary with a key "Pool_x0020_Access_x0020_Users"

3. The value of the dictionary is another collection

 

I can use a get item from collection action to get the following JSON (after I log the output in a log to history action)

 

{"Pool_x0020_Access_x0020_Users":[{"EMail":"Jake.Barton@email.com"},{"EMail":"Juan.AlonsoColmenares@email.com"},{"EMail":"B.Michels@email.com"},{"EMail":"Heather.Mellion@email.com"}]}

 

Now I have a dictionary.

It would make sense to use get value from a dictionary action by passing the key "Pool_x0020_Access_x0020_Users" and storing the result in a collection and this is where my workflow fails.

 

How do I get a value from a dictionary which happens to be a collection? It is a collection, right?

 

What I want?

Is the actual email addresses. I want them in a string separated by a delimited so I can append another email address to this string and save the final result in another people or group field.

 

Thank you

Outcomes