title: AWS API gateway to fetch records from multiple tables in a single API call
body: <p>I have two tables in DynamoDB both of which have same column/key "sessionid". Using AWS API gateway I want to fetch and display records from both tables when I pass the value for the column "sessionid" </p>
  
  <p>Currently, my mapping template looks like below which is retrieving records from Table1 only:
  Integration Request-</p>
  
  <pre><code> {
      "TableName": "Table1",
      "KeyConditionExpression": "sessionid = :v1",
      "ExpressionAttributeValues": {
          ":v1": {
                  "S": "$input.params('sessionid')"
                 }
      }
   }
  </code></pre>
  
  <p>Integration Response- </p>
  
  <pre><code> #set($inputRoot = $input.path('$'))
   {
       "Table1": [
           #foreach($elem in $inputRoot.Items) {
           "sessionid": "$elem.sessionid.S",
           "rowId": "$elem.rowId.S"
          }#if($foreach.hasNext),#end
              #end
        ]
   }
  </code></pre>
  
  <p>How can I integrate the mapping for the second table "Table2" in the above mapping, so records from both tables are retrieved in a single API call?</p>
  
  <p>Your suggestions will help.</p>