title: How do I Loop through a multi-value People Field or Lookup field in SharePoint 2013 designer using REST
body: <p>I have a multi-valued people picker and a multi-valued Lookup field that I need to read all the entries in a 2013 workflow.  I know how to create a workflow that retrieves the data and iterate through each list item using REST and a dictionary.  Given I'm iterating through each item, I need to now iterate through each multi-valued field.</p>
  
  <p>In the past, I have done this using a loop iterator and a second dictionary entry representing the data in the multi-valued field, but I don't have access to this code anymore.  I can use a loop and use the find function parsing through my responseContent, but this is not reliable since my reponseContent will have multiple records in it and I know it can be done using a second dictionary entry.</p>
  
  <p>My REST query is:</p>
  
  <pre><code>_api/lists/GetByTitle('EmailSetup')/Items?$select=EmailYN,EmailSubject,EmailBody,EmailTo/EMail,Emailcc/EMail,EmailToWorkflowPerson/Title,EmailccWorkflowPersons/Title&amp;$filter=(Title%20eq%20%27BSM%20Review%27)%20and%20(WorkflowName%20eq%20%27ProcessBSMRequests%27)&amp;$expand=EmailTo,Emailcc,EmailToWorkflowPerson,EmailccWorkflowPersons
  </code></pre>
  
  <p>Where my multi-valued fields are the Emailcc and EmailccWorkflowPerson, (people picker and lookup respectively).</p>
  
  <p>I have my first dictionary as the following data structure that captures the requestHeaders</p>
  
  <pre><code>Accept        String  application/json;odata=verbose
  Content-Type  String  application/json;odata=verbose
  </code></pre>
  
  <p>In my first loop I get all my attributes, but not certain how to get the multi-valued fields Emailcc and EmailccWorkflowPersons.</p>
  
  <p>Yes, I can parse through my response, but there's a better way to somehow put these multi-value fields into a structure and then loop through these.  </p>
  
  <p>What I need is what is that structure (dictionary) and how do you get the data into that structure and then how do you loop through that structure.</p>
  
  <p>The final result should be of the sort (psuedocode) where Index is which record I am on and Index2 is which multi-value I am on.</p>
  
  <pre><code>d/results([%Varaible: Index%])/Emailcc/Email[%Variable: Index2%])xxx
  </code></pre>