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

Scan

Last update:
May 18, 2026

Description

This function returns item and item attributes by iterating every item in a table or a secondary index.
For more information, see Scan.

Category

History

ColdFusion (2021 release): Added this function.

Syntax

serviceHandle.scan(requestParameters)

Parameters

See request parameters of Scan.

Example

<cfscript> 
   cred = { 
    "credentialAlias" : "myalias", 
    "vendorName" : "AWS", 
    "region" : "us-east-2", 
    "secretAccessKey" : "xxxxx", 
    "accessKeyId" : "xxxx" 
  } 
     
    conf={ 
        "serviceName"="DYNAMODB" 
    } 
 
    dynamo=getCloudService(cred, conf) 
 
    tableName="MusicTableForDemo" 
    scanStruct = { 
        "TableName": "#tableName#" 
    } 
 
    scanResponse=dynamo.scan(scanStruct,{"customResponse":true}) 
        
    arr=scanResponse.items 
    writeOutput("<b>List of songs</b>" & "<br/>") 
 
    mapFunction=function(item){ 
       writeOutput(item.SongTitle & "<br/>") 
    } 
 
    arr.map(mapFunction) 
</cfscript>

Output

List of songs
Angie
Hey Jude
Let it be
Yesterday
Hello
Hello, I Love You
Hello
Hello, I Love You

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