- CFML Reference User Guide
- ColdFusion functions
- ColdFusion functions by category
- Functions a-b
- Abs
- ACos
- AddSOAPRequestHeader
- AddSOAPResponseHeader
- AjaxLink
- AjaxOnLoad
- ApplicationStop
- ArrayAppend
- ArrayAvg
- ArrayClear
- ArrayContains
- ArrayContainsNoCase
- ArrayDelete
- ArrayDeleteAt
- ArrayDeleteNoCase
- ArrayEach
- ArrayFilter
- ArrayFind
- ArrayFindAll
- ArrayFindAllNoCase
- ArrayFindNoCase
- ArrayInsertAt
- ArrayIsDefined
- ArrayIsEmpty
- ArrayLen
- ArrayMap
- ArrayMax
- ArrayMin
- ArrayNew
- ArrayPrepend
- ArrayReduce
- ArrayResize
- ArraySet
- ArraySetMetadata
- ArraySlice
- ArraySort
- ArraySum
- ArraySwap
- ArrayToList
- Asc
- ASin
- Atn
- AuthenticatedContext
- AuthenticatedUser
- BinaryDecode
- BinaryEncode
- BitAnd
- BitMaskClear
- BitMaskRead
- BitMaskSet
- BitNot
- BitOr
- BitSHLN
- BitSHRN
- BitXor
- BooleanFormat
- Abs
- Functions-c-d
- CacheGet
- CacheGetAllIds
- CacheGetMetadata
- CacheGetProperties
- CacheGetSession
- CacheIdExists
- CachePut
- CacheRegionExists
- CacheRegionNew
- CacheRegionRemove
- CacheRemove
- CacheRemoveAll
- CacheSetProperties
- CallStackDump
- CallStackGet
- CanDeSerialize
- Canonicalize
- CanSerialize
- Ceiling
- CharsetDecode
- CharsetEncode
- Chr
- CJustify
- Compare
- CompareNoCase
- Cos
- CreateDate
- CreateDateTime
- CreateObject
- CreateObject: .NET object
- CreateObject: COM object
- CreateObject: component object
- CreateObject: CORBA object
- CreateObject: Java or EJB object
- CreateObject: web service object
- CreateODBCDate
- CreateODBCDateTime
- CreateODBCTime
- CreateSignedJWT
- CreateEncryptedJWT
- CreateTime
- CreateTimeSpan
- CreateUUID
- CSRFGenerateToken
- CSRFVerifyToken
- CSVRead
- CSVWrite
- CSVProcess
- DateAdd
- DateCompare
- DateConvert
- DateDiff
- DateFormat
- DatePart
- DateTimeFormat
- Day
- DayOfWeek
- DayOfWeekAsString
- DayOfYear
- DaysInMonth
- DaysInYear
- DE
- DecimalFormat
- DecodeForHTML
- DecodeFromURL
- DecrementValue
- Decrypt
- DecryptBinary
- DeleteClientVariable
- Deserialize
- DeserializeJSON
- DeserializeXML
- DirectoryCopy
- DirectoryCreate
- DirectoryDelete
- DirectoryExists
- DirectoryList
- DirectoryRename
- DollarFormat
- DotNetToCFType
- Duplicate
- Functions-e-g
- EncodeForCSS
- EncodeForDN
- EncodeForHTML
- EncodeForHTMLAttribute
- EncodeForJavaScript
- EncodeForLDAP
- EncodeForURL
- EncodeForXML
- EncodeForXMLAttribute
- EncodeForXpath
- Encrypt
- EncryptBinary
- EntityDelete
- EntityLoad
- EntityLoadByExample
- EntityLoadByPK
- EntityMerge
- EntityNew
- EntityReload
- EntitySave
- EntityToQuery
- Evaluate
- Exp
- ExpandPath
- FileClose
- FileCopy
- FileDelete
- FileExists
- FileGetMimeType
- FileIsEOF
- FileMove
- FileOpen
- FileRead
- FileReadBinary
- FileReadLine
- FileSeek
- FileSetAccessMode
- FileSetAttribute
- FileSetLastModified
- FileSkipBytes
- FileUpload
- FileUploadAll
- FileWrite
- FileWriteLine
- Find
- FindNoCase
- FindOneOf
- FirstDayOfMonth
- Fix
- Floor
- FormatBaseN
- GeneratePBKDFKey
- GenerateSecretKey
- GetApplicationMetadata
- GetAuthUser
- GetBaseTagData
- GetBaseTagList
- GetBaseTemplatePath
- GetClientVariablesList
- GetComponentMetaData
- GetContextRoot
- GetCPUUsage
- GetCurrentTemplatePath
- GetCSPNonce
- GetDirectoryFromPath
- GetEncoding
- GetException
- GetFileFromPath
- GetFileInfo
- GetFreeSpace
- GetFunctionCalledName
- GetFunctionList
- GetGatewayHelper
- GetHttpRequestData
- GetHttpTimeString
- GetK2ServerDocCount
- GetK2ServerDocCountLimit
- GetLocale
- GetLocaleDisplayName
- GetLocalHostIP
- GetMetaData
- GetMetricData
- GetPageContext
- GetPropertyString
- GetPropertyFile
- GetPrinterInfo
- GetPrinterList
- GetProfileSections
- GetProfileString
- GetReadableImageFormats
- GetSafeHTML
- GetSAMLAuthRequest
- GetSAMLLogoutRequest
- Generate3DesKey
- GenerateSAMLSPMetadata
- GetSOAPRequest
- GetSOAPRequestHeader
- GetSOAPResponse
- GetSOAPResponseHeader
- GetSystemFreeMemory
- GetSystemTotalMemory
- GetTempDirectory
- GetTempFile
- GetTemplatePath
- GetTickCount
- GetTimeZoneInfo
- GetToken
- GetTotalSpace
- GetUserRoles
- GetVFSMetaData
- GetWriteableImageFormats
- Functions-h-im
- Hash
- HMac
- Hour
- HQLMethods
- HTMLCodeFormat
- HTMLEditFormat
- IIf
- ImageAddBorder
- ImageBlur
- ImageClearRect
- ImageCopy
- ImageCreateCaptcha
- ImageCrop
- ImageDrawArc
- ImageDrawBeveledRect
- ImageDrawCubicCurve
- ImageDrawLine
- ImageDrawLines
- ImageDrawOval
- ImageDrawPoint
- ImageDrawQuadraticCurve
- ImageDrawRect
- ImageDrawRoundRect
- ImageDrawText
- ImageFlip
- ImageGetBlob
- ImageGetBufferedImage
- ImageGetEXIFMetadata
- ImageGetEXIFTag
- ImageGetHeight
- ImageGetIPTCMetadata
- ImageGetIPTCTag
- ImageGetMetadata
- ImageGetWidth
- ImageGrayscale
- ImageInfo
- ImageMakeColorTransparent
- ImageMakeTranslucent
- ImageNegative
- ImageNew
- ImageOverlay
- ImagePaste
- ImageRead
- ImageReadBase64
- ImageResize
- ImageRotate
- ImageRotateDrawingAxis
- ImageScaleToFit
- ImageSetAntialiasing
- ImageSetBackgroundColor
- ImageSetDrawingColor
- ImageSetDrawingStroke
- ImageSetDrawingTransparency
- ImageSharpen
- ImageShear
- ImageShearDrawingAxis
- ImageTranslate
- ImageTranslateDrawingAxis
- ImageWrite
- ImageWriteBase64
- ImageXORDrawingMode
- Functions-in-k
- IncrementValue
- InputBaseN
- Insert
- Int
- InterruptThread
- InvalidateOauthAccesstoken
- Invoke
- InitSAMLAuthRequest
- InitSAMLLogoutRequest
- InvokeCFClientFunction
- IsArray
- IsAuthenticated
- IsAuthorized
- IsBinary
- IsBoolean
- IsClosure
- IsCustomFunction
- IsDate
- IsDateObject
- IsDDX
- IsDebugMode
- IsDefined
- IsImage
- IsImageFile
- IsInstanceOf
- IsIPv6
- IsJSON
- IsK2ServerABroker
- IsK2ServerDocCountExceeded
- IsK2ServerOnline
- IsLeapYear
- IsLocalHost
- IsNull
- IsNumeric
- IsNumericDate
- IsObject
- isOnline
- IsPDFArchive
- IsPDFFile
- IsPDFObject
- IsProtected
- IsQuery
- isSamlLogoutResponse
- isSafeHTML
- IsSimpleValue
- IsSOAPRequest
- IsSpreadsheetFile
- IsSpreadsheetObject
- IsStruct
- isThreadInterrupted
- IsUserInAnyRole
- IsUserInRole
- IsUserLoggedIn
- IsValid
- IsValidOauthAccesstoken
- IsWDDX
- IsXML
- IsXmlAttribute
- IsXmlDoc
- IsXmlElem
- IsXmlNode
- IsXmlRoot
- JavaCast
- JSStringFormat
- Functions-l
- LCase
- Left
- Len
- ListAppend
- ListChangeDelims
- ListContains
- ListContainsNoCase
- ListDeleteAt
- ListEach
- ListFilter
- ListFind
- ListFindNoCase
- ListFirst
- ListGetAt
- ListGetDuplicates
- ListInsertAt
- ListLast
- ListLen
- ListMap
- ListPrepend
- ListQualify
- ListReduce
- ListRemoveDuplicates
- ListRest
- ListSetAt
- ListSort
- ListToArray
- ListValueCount
- ListValueCountNoCase
- LJustify
- Location
- Log
- Log10
- LSCurrencyFormat
- LSDateFormat
- LSDateTimeFormat
- LSEuroCurrencyFormat
- LSIsCurrency
- LSIsDate
- LSIsNumeric
- LSNumberFormat
- LSParseCurrency
- LSParseDateTime
- LSParseEuroCurrency
- LSParseNumber
- LSTimeFormat
- LTrim
- Functions-m-r
- Max
- Mid
- Min
- Minute
- Month
- MonthAsString
- Now
- NumberFormat
- ObjectEquals
- ObjectLoad
- ObjectSave
- OnWSAuthenticate
- ORMClearSession
- ORMCloseAllSessions
- ORMCloseSession
- ORMEvictCollection
- ORMEvictEntity
- ORMEvictQueries
- ORMExecuteQuery
- ORMFlush
- ORMFlushall
- ORMGetSession
- ORMGetSessionFactory
- ORMIndex
- ORMIndexPurge
- ORMReload
- ORMSearch
- ORMSearchOffline
- ParagraphFormat
- ParameterExists
- ParseDateTime
- Pi
- PrecisionEvaluate
- ProcessSAMLResponse
- ProcessSAMLLogoutRequest
- Quarter
- PreserveSingleQuotes
- QueryAddColumn
- QueryAddRow
- QueryConvertForGrid
- QueryExecute
- QueryFilter
- QueryGetResult
- QueryGetRow
- QueryKeyExists
- QueryMap
- QueryNew
- QueryReduce
- QuerySetCell
- QuotedValueList
- QueryEach
- Rand
- Randomize
- RandRange
- ReEscape
- REFind
- REFindNoCase
- ReleaseComObject
- REMatch
- REMatchNoCase
- RemoveCachedQuery
- RemoveChars
- RepeatString
- Replace
- ReplaceList
- ReplaceNoCase
- REReplace
- REReplaceNoCase
- RestDeleteApplication
- RestSetResponse
- RestInitApplication
- Reverse
- Right
- RJustify
- Round
- RTrim
- Functions-s
- Second
- SendGatewayMessage
- SendSAMLLogoutResponse
- Serialize
- SerializeJSON
- SerializeXML
- SessionInvalidate
- SessionRotate
- SessionGetMetaData
- SessionInvalidate
- SessionRotate
- SetDay
- SetEncoding
- SetHour
- SetLocale
- SetMonth
- SetProfileString
- SetPropertyString
- SetVariable
- SetYear
- Sgn
- Sin
- Sleep
- SpanExcluding
- SpanIncluding
- SpreadsheetAddAutoFilter
- SpreadsheetAddColumn
- SpreadsheetAddFreezePane
- SpreadsheetAddImage
- SpreadsheetAddInfo
- SpreadsheetAddPageBreaks
- SpreadsheetAddRow
- SpreadsheetAddRows
- SpreadsheetAddSplitPane
- SpreadsheetCreateSheet
- SpreadsheetDeleteColumn
- SpreadsheetDeleteColumns
- SpreadsheetDeleteRow
- SpreadsheetDeleteRows
- SpreadsheetFormatCell
- SpreadsheetFormatColumn
- SpreadsheetFormatCellRange
- SpreadsheetFormatColumn
- SpreadsheetFormatColumns
- SpreadsheetFormatRow
- SpreadsheetFormatRows
- SpreadsheetGetCellComment
- SpreadsheetGetCellFormula
- SpreadsheetGetCellValue
- SpreadsheetGetColumnCount
- SpreadsheetInfo
- SpreadsheetMergeCells
- SpreadsheetNew
- SpreadsheetRead
- SpreadsheetReadBinary
- SpreadsheetRemoveSheet
- SpreadsheetSetActiveSheet
- SpreadsheetSetActiveSheetNumber
- SpreadsheetSetCellComment
- SpreadsheetSetCellFormula
- SpreadsheetSetCellValue
- SpreadsheetSetColumnWidth
- SpreadsheetSetFooter
- SpreadsheetSetHeader
- SpreadsheetSetRowHeight
- SpreadsheetShiftColumns
- SpreadsheetShiftRows
- SpreadsheetWrite
- StreamingSpreadsheetNew
- StreamingSpreadsheetCleanup
- StreamingSpreadsheetRead
- StreamingSpreadsheetProcess
- SpreadsheetSetFooterImage
- SpreadsheetSetHeaderImage
- SpreadsheetSetFittoPage
- SpreadsheetUngroupColumns
- SpreadsheetGroupColumns
- SpreadsheetUngroupRows
- SpreadsheetGroupRows
- SpreadsheetRemoveColumnBreak
- SpreadsheetSetColumnBreak
- SpreadsheetRemoveRowBreak
- SpreadsheetSetRowBreak
- SpreadsheetRemovePrintGridlines
- SpreadsheetAddPrintGridlines
- SpreadsheetGetColumnWidth
- SpreadsheetSetColumnHidden
- SpreadsheetSetRowHidden
- SpreadsheetisColumnHidden
- SpreadsheetisRowHidden
- SpreadsheetisStreamingXmlFormat
- SpreadsheetisXmlFormat
- SpreadsheetisBinaryFormat
- SpreadsheetRenameSheet
- SpreadsheetRemoveSheetNumber
- SpreadsheetGetLastRowNumber
- SpreadsheetGetPrintOrientation
- Sqr
- StripCR
- StructAppend
- StructClear
- StructCopy
- StructCount
- StructDelete
- StructEach
- StructFilter
- StructFind
- StructFindKey
- StructFindValue
- StructGet
- StructGetMetadata
- StructInsert
- StructIsEmpty
- StructKeyArray
- StructKeyExists
- StructKeyList
- StructMap
- StructNew
- StructReduce
- StructSetMetadata
- StructSort
- StructToSorted
- StructUpdate
- StructValueArray
- StoreSetMetadata
- StoreGetACL
- StoreGetMetadata
- StoreAddACL
- StoreSetACL
- Functions-t-z
- Tan
- ThreadJoin
- ThreadTerminate
- Throw
- TimeFormat
- ToBase64
- ToBinary
- ToScript
- ToString
- Trace
- Transactionandconcurrency
- TransactionCommit
- TransactionRollback
- TransactionSetSavePoint
- Trim
- UCase
- URLDecode
- URLEncodedFormat
- URLSessionFormat
- Val
- ValueList
- VerifyClient
- Week
- Wrap
- WriteDump
- WriteLog
- WriteOutput
- WSGetAllChannels
- WSGetSubscribers
- WSPublish
- WSSendMessage
- XmlChildPos
- XmlElemNew
- XmlFormat
- XmlGetNodeType
- XmlNew
- XmlParse
- XmlSearch
- XmlTransform
- XmlValidate
- Year
- YesNoFormat
- ColdFusion tags
- ColdFusion tag summary
- ColdFusion tags by category
- Application framework tags
- Communications tags
- Database manipulation tags
- Data output tags
- Debugging tags
- Exception handling tags
- Extensibility tags
- File management tags
- Flow-control tags
- Forms tags
- Internet Protocol tags
- Page processing tags
- Security tags
- Variable manipulation tags
- Other tags
- Tags a-b
- Tags c
- cfcache
- cfcalendar
- cfcase
- cfcatch
- cfchart
- cfchart tag in ColdFusion
- Get started with cfchart
- Customize a chart using cfchart
- Advanced cfchart customization options
- Create an area chart in ColdFusion
- Create line charts in ColdFusion
- Create bar charts in ColdFusion
- Create floating bar charts in ColdFusion
- Create histograms in ColdFusion
- Create pie charts in ColdFusion
- Create funnel charts in ColdFusion
- Create pyramid charts in ColdFusion
- Create curve charts in ColdFusion
- Create boxplots in ColdFusion
- Create donut charts in ColdFusion
- Create bubble charts in ColdFusion
- Create scatterplots in ColdFusion
- Create radar charts in ColdFusion
- Other chart types in ColdFusion (Cone, Cylinder, Piano, and Bullet)
- Advanced customization options in cfchart
- cfchartdata
- cfchartseries
- cfchartset
- cfclient
- cfclientsettings
- cfcol
- cfcollection
- cfcomponent
- cfcontent
- cfcontinue
- cfcookie
- Tags f
- cffeed
- cffile
- cffile action = "append"
- cffile action = "copy"
- cffile action = "delete"
- cffile action = "move"
- cffile action = "read"
- cffile action = "readBinary"
- cffile action = "rename"
- cffile action = "upload"
- cffile action = "uploadAll"
- cffile action = "write"
- cffileupload
- cffinally
- cfflush
- cfform
- cfformgroup
- cfformitem
- cfftp
- cfftp: Connection: file and directory operations
- cfftp: Opening and closing FTP server connections
- cfftp : Opening and closing secure FTP server connections
- cfftp action = "listDir"
- cffunction
- Tags g-h
- Tags i
- Tags j-l
- cfjava
- cflayout
- cflayoutarea
- cfldap
- cflocation
- cflock
- cflog
- cflogin
- cfloginuser
- cflogout
- cfloop
- cfloop : conditional loop
- cfloop : index loop
- cfloop : looping over a COM collection or structure
- cfloop : looping over a date or time range
- cfloop : looping over a list, a file, or an array
- cfloop : looping over a query
- Tags m-o
- cfmail
- cfmailparam
- cfmailpart
- cfmap
- cfmapitem
- cfmediaplayer
- cfmenu
- cfmenuitem
- cfmessagebox
- cfmodule
- cfNTauthenticate
- cfoauth
- cfobject
- cfobject: .NET object
- cfobject: COM object
- cfobject: component object
- cfobject: CORBA object
- cfobject: Java or EJB object
- cfobject: web service object
- cfobjectcache
- cfoutput
- Tags p-q
- Tags r-s
- Tags t
- Tags u-z
- CFML Reference
- Reserved words and variables
- Ajax JavaScript functions
- Ajax JavaScript functions
- Function summary Ajax
- ColdFusion.Ajax.submitForm
- ColdFusion.Autosuggest.getAutosuggestObject
- ColdFusion.Layout.enableSourceBind
- ColdFusion.MessageBox.getMessageBoxObject
- ColdFusion.ProgressBar.getProgressBarObject
- ColdFusion.MessageBox.isMessageBoxDefined
- JavaScriptFunctionsinColdFusion9Update1
- ColdFusion ActionScript functions
- ColdFusion mobile functions
- Application.cfc reference
- Script functions implemented as CFCs
- ColdFusion Flash Form style reference
- Styles valid for all controls
- Styles for cfform
- Styles for cfformgroup with horizontal or vertical type attributes
- Styles for box-style cfformgroup elements
- Styles for cfformgroup with accordion type attribute
- Styles for cfformgroup with tabnavigator type attribute
- Styles for cfformitem with hrule or vrule type attributes
- Styles for cfinput with radio, checkbox, button, image, or submit type attributes
- Styles for cftextarea tag and cfinput with text, password, or hidden type attributes
- Styles for cfselect with size attribute value of 1
- Styles for cfselect with size attribute value greater than 1
- Styles for cfcalendar tag and cfinput with dateField type attribute
- Styles for the cfgrid tag
- Styles for the cftree tag
- ColdFusion Flash Form Style Reference
- ColdFusion event gateway reference
- ColdFusion Event Gateway reference
- addEvent
- CFEvent
- CFEventclass
- Constructor
- Gateway development interfaces and classes
- getStatus
- setCFCPath
- setCFCMethod
- getOriginatorID
- getLogger
- getBuddyList
- getBuddyInfo
- IM gateway message sending commands
- IM Gateway GatewayHelper class methods
- onIncomingMessage
- onIMServerMessage
- onBuddyStatus
- onAddBuddyResponse
- onAddBuddyRequest
- IM Gateway CFC incoming message methods
- IM gateway methods and commands
- CFML CFEvent structure
- warn
- info
- setOriginatorID
- data command
- submit Multi command
- submit command
- setGatewayType
- setGatewayID
- setData
- setCFCListeners
- outgoingMessage
- getStatusTimeStamp
- numberOfMessagesReceived
- numberOfMessagesSent
- removeBuddy
- removeDeny
- removePermit
- setNickName
- setPermitMode
- setStatus
- SMS Gateway CFEvent structure and commands
- SMS Gateway incoming message CFEvent structure
- getStatusAsString
- getProtocolName
- getPermitMode
- getPermitList
- getNickName
- getName
- getDenyList
- getCustomAwayMessage
- getQueueSize
- getMaxQueueSize
- getHelper
- getGatewayType
- getGatewayServices
- getGatewayID_1
- getGatewayID
- getData
- getCFCTimeout
- setCFCTimeout
- getCFCPath
- getCFCMethod
- GatewayServices class
- Gateway interface
- GatewayHelper interface
- addPermit
- addDeny
- addBuddy
- error
- debug
- Logger class
- stop
- start
- CFML event gateway SendGatewayMessage data parameter
- restart
- fatal
- SMS gateway message sending commands
- ColdFusion C++ CFX Reference
- ColdFusion Java CFX reference
- WDDX JavaScript Objects
- Cloud services
- ColdFusion and GCP Storage
- ColdFusion and GCP Firestore
- ColdFusion and GCP PubSub
- ColdFusion and Amazon S3
- ColdFusion and DynamoDB
- ColdFusion and Amazon SQS
- ColdFusion and Amazon SNS
- ColdFusion and MongoDB
- ColdFusion and Azure Blob
- ColdFusion and Azure Service Bus
- Multi-cloud storage services
- Multi-cloud RDS databases
- ColdFusion and Azure Cosmos DB
Description
Inserts a delimiter between each value in an executed query. ColdFusion does not evaluate the arguments.
Returns
A delimited list of the values of each record returned from an executed query.
Category
List functions, Query functions
Function syntax
ValueList(queryColumn [, delimiter ])
History
ColdFusion (2018 release): Introduced named parameters.
See also
Parameters
Parameter |
Description |
|---|---|
queryColumn |
Name of an executed query and column. Separate query name and column name with a period. |
delimiter |
A delimiter character to separate column data items. The default value is comma (,). |
Example
<cfscript>
myQuery=queryNew("id,title", "integer,varchar",
[ {"id":1,"title":"Iron Maiden"},
{"id":2,"title":"Judas Priest"},
{"id":3,"title":"Black Sabbath"},
{"id":4,"title":"Deep Purple"},
{"id":5,"title":"Rolling Stones"}
]);
valueListTitle=ValueList(myQuery.title)
writeOutput(valueListTitle)
</cfscript>
Output
Iron Maiden,Judas Priest,Black Sabbath,Deep Purple,Rolling Stones
Real-world use cases of the ValueList function
Email marketing- Customer mailing lists
A marketing department needs to create targeted email campaigns for different customer segments. The CRM system stores thousands of customer emails in a relational database, and marketing teams need to extract these emails into formats compatible with bulk email systems and campaign management platforms.
How it helps:
- Direct conversion from CRM queries to email-ready lists
- Multiple delimiter options for different email platforms
- Filter and target specific customer groups dynamically
- Systematic data extraction eliminates manual copy-paste errors
<cfscript>
writeOutput("<h2>📧 USE CASE 1: Email Marketing - Customer Mailing Lists</h2>");
writeOutput("<h3>Business Context:</h3>");
writeOutput("<p>A marketing department needs to create targeted email campaigns for different customer segments. The CRM system stores customer emails in a database, and ValueList helps convert query results into email lists for bulk messaging systems.</p>");
// Create sample customer data
customerQuery = queryNew("customerID,email,segment,status", "integer,varchar,varchar,varchar", [
{"customerID": 1001, "email": "john.smith@techcorp.com", "segment": "Enterprise", "status": "Active"},
{"customerID": 1002, "email": "mary.jones@startup.io", "segment": "SMB", "status": "Active"},
{"customerID": 1003, "email": "david.wilson@retailplus.com", "segment": "Enterprise", "status": "Active"},
{"customerID": 1004, "email": "sarah.brown@localshop.net", "segment": "SMB", "status": "Active"},
{"customerID": 1005, "email": "mike.davis@corp.example.com", "segment": "Enterprise", "status": "Inactive"}
]);
writeOutput("<h4>📊 Customer Database Sample:</h4>");
writeOutput("<table border='1' cellpadding='8'>");
writeOutput("<tr><th>Customer ID</th><th>Email</th><th>Segment</th><th>Status</th></tr>");
for (row = 1; row <= customerQuery.recordCount; row++) {
writeOutput("<tr>");
writeOutput("<td>" & customerQuery.customerID[row] & "</td>");
writeOutput("<td>" & customerQuery.email[row] & "</td>");
writeOutput("<td>" & customerQuery.segment[row] & "</td>");
writeOutput("<td>" & customerQuery.status[row] & "</td>");
writeOutput("</tr>");
}
writeOutput("</table>");
// Filter active customers for email campaign
activeCustomerQuery = queryNew("email,segment", "varchar,varchar");
for (row = 1; row <= customerQuery.recordCount; row++) {
if (customerQuery.status[row] == "Active") {
queryAddRow(activeCustomerQuery);
querySetCell(activeCustomerQuery, "email", customerQuery.email[row]);
querySetCell(activeCustomerQuery, "segment", customerQuery.segment[row]);
}
}
// Generate email lists using ValueList
allActiveEmails = ValueList(activeCustomerQuery.email);
enterpriseEmails = ValueList(activeCustomerQuery.email, ";"); // Using semicolon delimiter
writeOutput("<h4>📧 Generated Email Lists:</h4>");
// writeOutput("<div style='background-color: #f8f9fa; padding: 15px; border: 1px solid #ddd;'>");
writeOutput("<p><strong>All Active Customers (Comma-delimited):</strong></p>");
writeOutput("<p><code>" & allActiveEmails & "</code></p>");
writeOutput("<p><strong>Email Count:</strong> " & listLen(allActiveEmails) & " recipients</p>");
writeOutput("<p><strong>All Active Customers (Semicolon-delimited):</strong></p>");
writeOutput("<p><code>" & enterpriseEmails & "</code></p>");
writeOutput("<p><strong>Ready for bulk email system import</strong></p>");
writeOutput("</div>");
</cfscript>
eCommerce- Product category dropdowns
An e-commerce website serves thousands of products across multiple categories and needs to provide intuitive navigation for customers. Product categories are stored in a database and must be dynamically presented as dropdown menus, breadcrumb navigation, and filter options throughout the website.
How it helps:
- Category menus automatically reflect new product additions
- Uniform navigation presentation across all website sections
- Single query generates all navigation elements
- Eliminates manual navigation maintenance
<cfscript>
// Create sample product category data
categoryQuery = queryNew("categoryID,categoryName,productCount", "integer,varchar,integer", [
{"categoryID": 101, "categoryName": "Electronics", "productCount": 245},
{"categoryID": 102, "categoryName": "Clothing", "productCount": 189},
{"categoryID": 103, "categoryName": "Home & Garden", "productCount": 156},
{"categoryID": 104, "categoryName": "Sports & Outdoors", "productCount": 98},
{"categoryID": 105, "categoryName": "Books & Media", "productCount": 67}
]);
writeOutput("<h4>📊 Product Categories Database:</h4>");
writeOutput("<table border='1' cellpadding='8'>");
writeOutput("<tr><th>Category ID</th><th>Category Name</th><th>Product Count</th></tr>");
for (row = 1; row <= categoryQuery.recordCount; row++) {
writeOutput("<tr>");
writeOutput("<td>" & categoryQuery.categoryID[row] & "</td>");
writeOutput("<td>" & categoryQuery.categoryName[row] & "</td>");
writeOutput("<td>" & categoryQuery.productCount[row] & "</td>");
writeOutput("</tr>");
}
writeOutput("</table>");
// Generate lists for different purposes
categoryNames = ValueList(categoryQuery.categoryName);
categoryIDs = ValueList(categoryQuery.categoryID, "|");
writeOutput("<h4>🎯 Generated Category Lists:</h4>");
//writeOutput("<div style='background-color: #f8f9fa; padding: 15px; border: 1px solid #ddd;'>");
writeOutput("<p><strong>Category Names (for display):</strong></p>");
writeOutput("<p><code>" & categoryNames & "</code></p>");
writeOutput("<p><strong>Category IDs (for form values):</strong></p>");
writeOutput("<p><code>" & categoryIDs & "</code></p>");
writeOutput("</div>");
// Simulate HTML dropdown generation
writeOutput("<h4>🌐 HTML Dropdown Implementation:</h4>");
//writeOutput("<div style='background-color: #e8f5e8; padding: 15px; border-left: 4px solid #28a745;'>");
writeOutput("<p><strong>Generated HTML Select:</strong></p>");
writeOutput("<select name='category' style='padding: 8px; font-size: 14px;'>");
writeOutput("<option value=''>Select Category...</option>");
categoryNameList = listToArray(categoryNames);
categoryIDList = listToArray(categoryIDs, "|");
for (i = 1; i <= arrayLen(categoryNameList); i++) {
if (i <= arrayLen(categoryIDList)) {
writeOutput("<option value='" & categoryIDList[i] & "'>" & categoryNameList[i] & "</option>");
}
}
writeOutput("</select>");
writeOutput("<p><strong>Dynamic dropdown with " & listLen(categoryNames) & " categories</strong></p>");
writeOutput("</div>");
</cfscript>
HR management- Employee skills aggregation
A technology consulting firm manages 200+ employees across multiple projects and needs to track, analyze, and report on employee skills for project staffing, training initiatives, and strategic workforce planning. Skills data is stored individually per employee and requires aggregation for management reporting and resource allocation.
How it helps:
- Detailed view of organizational capabilities
- Efficient matching of skills to project needs
- Data-driven identification of skill development priorities
- Workforce capability insights for business growth
<cfscript>
// Create sample employee skills data
employeeSkillsQuery = queryNew("employeeID,employeeName,skill,proficiency", "integer,varchar,varchar,varchar", [
{"employeeID": 2001, "employeeName": "Alice Johnson", "skill": "Java", "proficiency": "Expert"},
{"employeeID": 2001, "employeeName": "Alice Johnson", "skill": "Python", "proficiency": "Advanced"},
{"employeeID": 2002, "employeeName": "Bob Smith", "skill": "JavaScript", "proficiency": "Expert"},
{"employeeID": 2002, "employeeName": "Bob Smith", "skill": "React", "proficiency": "Advanced"},
{"employeeID": 2003, "employeeName": "Carol Davis", "skill": "SQL", "proficiency": "Expert"},
{"employeeID": 2003, "employeeName": "Carol Davis", "skill": "Python", "proficiency": "Intermediate"},
{"employeeID": 2004, "employeeName": "David Wilson", "skill": "Java", "proficiency": "Advanced"},
{"employeeID": 2004, "employeeName": "David Wilson", "skill": "SQL", "proficiency": "Expert"}
]);
writeOutput("<h4>📊 Employee Skills Database:</h4>");
writeOutput("<table border='1' cellpadding='8'>");
writeOutput("<tr><th>Employee ID</th><th>Employee Name</th><th>Skill</th><th>Proficiency</th></tr>");
for (row = 1; row <= employeeSkillsQuery.recordCount; row++) {
writeOutput("<tr>");
writeOutput("<td>" & employeeSkillsQuery.employeeID[row] & "</td>");
writeOutput("<td>" & employeeSkillsQuery.employeeName[row] & "</td>");
writeOutput("<td>" & employeeSkillsQuery.skill[row] & "</td>");
writeOutput("<td>" & employeeSkillsQuery.proficiency[row] & "</td>");
writeOutput("</tr>");
}
writeOutput("</table>");
// Generate skills summary lists
allSkills = ValueList(employeeSkillsQuery.skill);
uniqueEmployees = ValueList(employeeSkillsQuery.employeeName, " | ");
// Create expert-level skills query
expertSkillsQuery = queryNew("skill", "varchar");
for (row = 1; row <= employeeSkillsQuery.recordCount; row++) {
if (employeeSkillsQuery.proficiency[row] == "Expert") {
queryAddRow(expertSkillsQuery);
querySetCell(expertSkillsQuery, "skill", employeeSkillsQuery.skill[row]);
}
}
expertSkills = ValueList(expertSkillsQuery.skill, " • ");
writeOutput("<h4>📋 Skills Summary Reports:</h4>");
//writeOutput("<div style='background-color: #f8f9fa; padding: 15px; border: 1px solid #ddd;'>");
writeOutput("<p><strong>All Skills in Organization:</strong></p>");
writeOutput("<p><code>" & allSkills & "</code></p>");
writeOutput("<p><strong>Total Skill Entries:</strong> " & listLen(allSkills) & "</p>");
writeOutput("<p><strong>Team Members:</strong></p>");
writeOutput("<p><code>" & uniqueEmployees & "</code></p>");
writeOutput("<p><strong>Expert-Level Skills (for critical projects):</strong></p>");
writeOutput("<p><code>" & expertSkills & "</code></p>");
writeOutput("</div>");
// Skills frequency analysis
skillsArray = listToArray(allSkills);
skillFrequency = {};
for (skill in skillsArray) {
if (!structKeyExists(skillFrequency, skill)) {
skillFrequency[skill] = 0;
}
skillFrequency[skill]++;
}
writeOutput("<h4>📈 Skills Frequency Analysis:</h4>");
writeOutput("<table border='1' cellpadding='8'>");
writeOutput("<tr><th>Skill</th><th>Number of Employees</th><th>Organizational Strength</th></tr>");
for (skill in skillFrequency) {
count = skillFrequency[skill];
strength = count >= 3 ? "Strong" : (count >= 2 ? "Moderate" : "Limited");
strengthColor = count >= 3 ? "green" : (count >= 2 ? "blue" : "red");
writeOutput("<tr>");
writeOutput("<td><strong>" & skill & "</strong></td>");
writeOutput("<td>" & count & "</td>");
writeOutput("<td style='color: " & strengthColor & ";'>" & strength & "</td>");
writeOutput("</tr>");
}
writeOutput("</table>");
</cfscript>
Logistics- Warehouse location tracking
A distribution center processes 2,000+ orders daily across a 100,000 square foot warehouse facility. Inventory is stored in specific bin locations across multiple zones, and order fulfillment requires efficient picking routes to minimize travel time and maximize productivity. Location data needs to be converted into optimized picking sequences.
How it helps:
- Systematic picking sequences reduce travel time
- Coordinated workflows between warehouse areas
- Clear location sequences for new employees
- Organized picking reduces location mistakes
<cfscript>
// Create sample inventory location data
inventoryQuery = queryNew("productCode,productName,warehouseZone,binLocation", "varchar,varchar,varchar,varchar", [
{"productCode": "ELEC001", "productName": "Wireless Headphones", "warehouseZone": "A", "binLocation": "A-15-03"},
{"productCode": "ELEC002", "productName": "Bluetooth Speaker", "warehouseZone": "A", "binLocation": "A-12-07"},
{"productCode": "BOOK001", "productName": "Programming Guide", "warehouseZone": "C", "binLocation": "C-08-12"},
{"productCode": "CLTH001", "productName": "Cotton T-Shirt", "warehouseZone": "B", "binLocation": "B-22-05"},
{"productCode": "ELEC003", "productName": "USB Cable", "warehouseZone": "A", "binLocation": "A-18-09"},
{"productCode": "HOME001", "productName": "Coffee Mug", "warehouseZone": "D", "binLocation": "D-05-15"}
]);
writeOutput("<h4>📊 Warehouse Inventory Database:</h4>");
writeOutput("<table border='1' cellpadding='8'>");
writeOutput("<tr><th>Product Code</th><th>Product Name</th><th>Zone</th><th>Bin Location</th></tr>");
for (row = 1; row <= inventoryQuery.recordCount; row++) {
writeOutput("<tr>");
writeOutput("<td>" & inventoryQuery.productCode[row] & "</td>");
writeOutput("<td>" & inventoryQuery.productName[row] & "</td>");
writeOutput("<td>" & inventoryQuery.warehouseZone[row] & "</td>");
writeOutput("<td>" & inventoryQuery.binLocation[row] & "</td>");
writeOutput("</tr>");
}
writeOutput("</table>");
// Generate location lists for different purposes
allBinLocations = ValueList(inventoryQuery.binLocation);
warehouseZones = ValueList(inventoryQuery.warehouseZone, " → ");
pickingRoute = ValueList(inventoryQuery.binLocation, " → ");
// Filter Zone A locations for electronics picking
zoneAQuery = queryNew("binLocation", "varchar");
for (row = 1; row <= inventoryQuery.recordCount; row++) {
if (inventoryQuery.warehouseZone[row] == "A") {
queryAddRow(zoneAQuery);
querySetCell(zoneAQuery, "binLocation", inventoryQuery.binLocation[row]);
}
}
zoneALocations = ValueList(zoneAQuery.binLocation, " ➜ ");
writeOutput("<h4>🎯 Generated Location Lists:</h4>");
//writeOutput("<div style='background-color: #f8f9fa; padding: 15px; border: 1px solid #ddd;'>");
writeOutput("<p><strong>All Bin Locations:</strong></p>");
writeOutput("<p><code>" & allBinLocations & "</code></p>");
writeOutput("<p><strong>Warehouse Zone Route:</strong></p>");
writeOutput("<p><code>" & warehouseZones & "</code></p>");
writeOutput("<p><strong>Electronics Zone A Picking Route:</strong></p>");
writeOutput("<p><code>" & zoneALocations & "</code></p>");
writeOutput("<p><strong>Complete Picking Route:</strong></p>");
writeOutput("<p><code>" & pickingRoute & "</code></p>");
writeOutput("</div>");
// Generate zone summary
zoneArray = listToArray(warehouseZones, " → ");
zoneCounts = {};
for (zone in zoneArray) {
if (!structKeyExists(zoneCounts, zone)) {
zoneCounts[zone] = 0;
}
zoneCounts[zone]++;
}
writeOutput("<h4>📈 Warehouse Zone Analysis:</h4>");
writeOutput("<table border='1' cellpadding='8'>");
writeOutput("<tr><th>Warehouse Zone</th><th>Number of Items</th><th>Pick Priority</th></tr>");
for (zone in zoneCounts) {
count = zoneCounts[zone];
priority = count >= 3 ? "High Volume" : (count >= 2 ? "Medium Volume" : "Low Volume");
priorityColor = count >= 3 ? "red" : (count >= 2 ? "orange" : "green");
writeOutput("<tr>");
writeOutput("<td><strong>Zone " & zone & "</strong></td>");
writeOutput("<td>" & count & " items</td>");
writeOutput("<td style='color: " & priorityColor & ";'>" & priority & "</td>");
writeOutput("</tr>");
}
writeOutput("</table>");
</cfscript>
