title: logic app foreach - variable body?
body: <p>I have an action called Get_row which outputs "Package1Id" and "Package2Id" values. I want to use a foreach loop to access these values as shown below:</p>
  
  <pre><code>"parameters": {
     "packages": {
       "type": "array",
       "defaultValue": "\"[ \"Package1\", \"Package2\" ]\""
     }
  }
  
  "forEach_package": {
    "type": "foreach",
    "foreach": "[parameters('packages')]",
    "actions": {
      "process_package": {
        "type": "Compose",
        "inputs": {
          "what": "@{body('Get_row')?[coalesce(item(), 'Id')]}"
        }
      }
    }
  }
  </code></pre>
  
  <p>So the "what" values should essentially be:</p>
  
  <pre><code>"what": "@{body('Get_row')?['Package1Id']}"
  "what": "@{body('Get_row')?['Package2Id']}"
  </code></pre>
  
  <p>I cannot seem to get it to work or find any examples anywhere. 
  Any ideas if I can do this?
  TIA</p>