Whatever message this page gives is out now! Go check it out!

BatchGetItem

Last update:
May 18, 2026

Description

This function returns the attributes from one or more items from a table or tables. You must use a primary key to identify the items that you want to retrieve.
For more information, see BatchGetItem.

Category

History

ColdFusion (2021 release): Added this function.

Syntax

serviceHandle.batchGetItem(requestParameters)

Parameters

See request parameters of BatchGetItem.

Example

<cfscript> 
  cred={ 
    cred = { 
        "credentialAlias" : "myalias", 
        "vendorName" : "AWS", 
        "region" : "us-east-2", 
        "secretAccessKey" : "xxxxx", 
        "accessKeyId" : "xxxx" 
  } 
  } 
 
  conf={ 
    "serviceName"="DYNAMODB" 
  } 
 
  dynamo=getCloudService(cred, conf) 
  tableName="batchWriteMovie" 
 
  // get items from table 
  batchGetItemStruct={ 
    "RequestItems":{ 
    "#tableName#":{ 
      "Keys":[ 
        { 
          "year":2018, 
          "title":"Solo" 
        }, 
        { 
          "year":2018, 
          "title":"Hereditary" 
        } 
      ] 
    } 
    } 
  } 
  try{ 
    batchGetItemResponse=dynamo.batchGetItem(batchGetItemStruct,{ 
      "customResponse":true 
    }) 
    writeOutput("Items retrieved successfully") 
    writeDump(batchGetItemResponse) 
  } 
  catch(any e){ 
    writeDump(e) 
  } 
</cfscript>

Share this page

Was this page helpful?
We're glad. Tell us how this page helped.
We're sorry. Can you tell us what didn't work for you?
Thank you for your feedback. Your response will help improve this page.

On this page