- 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
Converts a one-dimensional array to a list.
Returns
Delimited list, as a string.
Category
Array functions, Conversion functions, List functions
Function syntax
ArrayToList(array [, delimiter ]) |
Parameters
Parameter |
Description |
|---|---|
array |
Name of array |
delimiter |
Character or multicharacter string to separate list elements. The default value is comma . |
Example
<cfscript>
// Declare an array
myArray=["Google","Microsoft","Adobe","Facebook","Amazon"];
myConvertedList=myArray.toList();
WriteOutput(myConvertedList);
</cfscript>
Output
Google,Microsoft,Adobe,Facebook,Amazon
Example using member function
<cfscript>
// Declare an array
myArray=["Google","Microsoft","Adobe","Facebook","Amazon"];
myConvertedList=myArray.toList();
WriteOutput(myConvertedList);
</cfscript>
Output
Google,Microsoft,Adobe,Facebook,Amazon
Real-world uses of the ArrayToList function
Email marketing distribution lists
Marketing teams manage email campaigns for multiple customer segments, requiring targeted distribution lists for various email service providers and marketing automation platforms. Manual email list compilation from customer arrays takes 2-3 hours per campaign with 25% error rate. Email platforms require specific delimiter formats (comma, semicolon, pipe) that vary by provider and region. Use ArrayToList to instantly convert customer segment arrays to any required email distribution format.
<cfscript>
// Customer segmentation data (typically from database queries)
premiumCustomerEmails = [
"john.doe@company.com",
"sarah.johnson@business.org",
"michael.brown@enterprise.net",
"lisa.davis@corporation.com",
"david.wilson@firm.co"
];
newSubscriberEmails = [
"alice.smith@email.com",
"bob.jones@service.com",
"carol.miller@agency.net",
"daniel.garcia@group.org"
];
loyalCustomerEmails = [
"emma.taylor@company.net",
"frank.anderson@business.com",
"grace.thomas@enterprise.org",
"henry.jackson@firm.net",
"isabel.martin@corp.com",
"james.rodriguez@agency.co"
];
</cfscript>
<cfoutput>
<h2>🎯 Email Campaign Targeting</h2>
<div style="background: ##f8f9fa; padding: 15px; border-radius: 5px; margin: 15px 0;">
<h3>🔧 ArrayToList Implementation:</h3>
<div style="background: white; padding: 15px; border-radius: 3px; font-family: monospace; font-size: 1.1em;">
emailList = ArrayToList(customerEmails, ",");<br>
// Send to email service provider
</div>
<cfscript>
// Convert customer arrays to email distribution lists
premiumEmailList = ArrayToList(premiumCustomerEmails, ",");
newSubscriberList = ArrayToList(newSubscriberEmails, ",");
loyalCustomerList = ArrayToList(loyalCustomerEmails, ",");
// Alternative syntax (ColdFusion 2016+)
premiumEmailList_Modern = premiumCustomerEmails.toList(",");
// For different email service providers requiring different formats
semicolonList = ArrayToList(premiumCustomerEmails, ";");
pipeDelimitedList = ArrayToList(premiumCustomerEmails, "|");
// Calculate campaign metrics
premiumCount = ArrayLen(premiumCustomerEmails);
newSubscriberCount = ArrayLen(newSubscriberEmails);
loyalCustomerCount = ArrayLen(loyalCustomerEmails);
totalRecipients = premiumCount + newSubscriberCount + loyalCustomerCount;
</cfscript>
<h3>📊 Campaign Results:</h3>
<div style="display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 15px; margin: 20px 0;">
<div style="background: white; padding: 15px; border-radius: 5px; border-left: 4px solid ##28a745;">
<h4 style="margin-top: 0; color: ##28a745;">🏆 Premium Customers</h4>
<p><strong>Count:</strong> #premiumCount# recipients</p>
<p><strong>Campaign:</strong> Exclusive VIP Offers</p>
<div style="background: ##f8f9fa; padding: 8px; border-radius: 3px; font-size: 0.85em; word-break: break-all;">
<strong>Email List:</strong><br>
#Left(premiumEmailList, 100)#...
</div>
</div>
<div style="background: white; padding: 15px; border-radius: 5px; border-left: 4px solid ##17a2b8;">
<h4 style="margin-top: 0; color: ##17a2b8;">🆕 New Subscribers</h4>
<p><strong>Count:</strong> #newSubscriberCount# recipients</p>
<p><strong>Campaign:</strong> Welcome Series</p>
<div style="background: ##f8f9fa; padding: 8px; border-radius: 3px; font-size: 0.85em; word-break: break-all;">
<strong>Email List:</strong><br>
#newSubscriberList#
</div>
</div>
<div style="background: white; padding: 15px; border-radius: 5px; border-left: 4px solid ##fd7e14;">
<h4 style="margin-top: 0; color: ##fd7e14;">❤️ Loyal Customers</h4>
<p><strong>Count:</strong> #loyalCustomerCount# recipients</p>
<p><strong>Campaign:</strong> Loyalty Rewards</p>
<div style="background: ##f8f9fa; padding: 8px; border-radius: 3px; font-size: 0.85em; word-break: break-all;">
<strong>Email List:</strong><br>
#Left(loyalCustomerList, 100)#...
</div>
</div>
</div>
<h3>🚀 Email Service Integration Examples:</h3>
<div style="background: ##fff3cd; padding: 15px; border-radius: 5px; margin: 15px 0;">
<h4>📮 Mailchimp API Integration:</h4>
<div style="background: white; padding: 10px; border-radius: 3px; font-family: monospace; font-size: 0.9em;">
// Send campaign to premium customers<br>
mailchimpAPI.createCampaign({<br>
type: "regular",<br>
recipients: {<br>
list_id: "premium_list",<br>
segment_opts: {<br>
saved_segment_id: null,<br>
match: "any",<br>
conditions: [{<br>
condition_type: "EmailAddress",<br>
field: "EMAIL",<br>
op: "is",<br>
value: "#premiumEmailList#"<br>
}]<br>
}<br>
}<br>
});
</div>
</div>
<div style="background: ##e8f4f8; padding: 15px; border-radius: 5px; margin: 15px 0;">
<h4>📧 SendGrid API Integration:</h4>
<div style="background: white; padding: 10px; border-radius: 3px; font-family: monospace; font-size: 0.9em;">
// SendGrid bulk email<br>
sendGridAPI.send({<br>
to: "#newSubscriberList#",<br>
from: "marketing@company.com",<br>
subject: "Welcome to Our Community!",<br>
html: welcomeTemplate,<br>
category: "new_subscriber_welcome"<br>
});
</div>
</div>
<div style="background: ##f8d7da; padding: 15px; border-radius: 5px; margin: 15px 0;">
<h4>📬 SMTP Server Integration:</h4>
<div style="background: white; padding: 10px; border-radius: 3px; font-family: monospace; font-size: 0.9em;">
<cfmail<br>
to="#loyalCustomerList#"<br>
from="rewards@company.com"<br>
subject="Exclusive Loyalty Rewards Inside!"<br>
server="smtp.company.com"<br>
port="587"<br>
username="marketing"<br>
password="[password]"><br>
[Email content here]<br>
</cfmail>
</div>
</div>
<h3>📈 Campaign Performance Tracking:</h3>
<div style="background: ##d4edda; padding: 15px; border-radius: 5px; margin: 15px 0;">
<div style="display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 15px;">
<div style="background: white; padding: 15px; border-radius: 5px; text-align: center;">
<h3 style="margin: 0; color: ##28a745;">#totalRecipients#</h3>
<p style="margin: 5px 0 0 0;">Total Recipients</p>
</div>
<div style="background: white; padding: 15px; border-radius: 5px; text-align: center;">
<h3 style="margin: 0; color: ##17a2b8;">3</h3>
<p style="margin: 5px 0 0 0;">Campaign Segments</p>
</div>
<div style="background: white; padding: 15px; border-radius: 5px; text-align: center;">
<h3 style="margin: 0; color: ##fd7e14;"><1ms</h3>
<p style="margin: 5px 0 0 0;">List Generation</p>
</div>
<div style="background: white; padding: 15px; border-radius: 5px; text-align: center;">
<h3 style="margin: 0; color: ##6f42c1;">100%</h3>
<p style="margin: 5px 0 0 0;">Data Accuracy</p>
</div>
</div>
</div>
<h3>🔄 Alternative Format Examples:</h3>
<div style="background: ##f8f9fa; padding: 15px; border-radius: 5px;">
<h4>Different Delimiter Formats:</h4>
<p><strong>Semicolon (European CSV):</strong></p>
<div style="background: white; padding: 8px; border-radius: 3px; font-family: monospace; font-size: 0.85em; word-break: break-all;">
#Left(semicolonList, 120)#...
</div>
<p><strong>Pipe Delimited (Database Import):</strong></p>
<div style="background: white; padding: 8px; border-radius: 3px; font-family: monospace; font-size: 0.85em; word-break: break-all;">
#Left(pipeDelimitedList, 120)#...
</div>
<cfscript>
// For display purposes (readable format)
displayList = ArrayToList(premiumCustomerEmails, " • ");
</cfscript>
<p><strong>Bullet Separated (User Display):</strong></p>
<div style="background: white; padding: 8px; border-radius: 3px; font-size: 0.9em;">
#Left(displayList, 150)#...
</div>
</div>
</div>
</cfoutput>
Database query generation
E-commerce applications with advanced product filtering require dynamic SQL queries based on user-selected categories, brands, and criteria without performance degradation. Multiple OR conditions cause poor database performance and SQL injection risks. Manual query building for filter combinations requires 60% of development time with exponential complexity growth. Use ArrayToList to convert user filter selections into optimized SQL IN clauses for maximum database performance.
<cfscript>
// User-selected filter criteria (typically from form submissions or URL parameters)
selectedCategoryIDs = [101, 205, 312, 487, 556, 623];
selectedBrandIDs = [15, 23, 41, 67, 89];
selectedPriceRanges = [1, 3, 5]; // 1=Under $50, 3=$100-200, 5=Over $500
selectedRegionIDs = [1, 3, 7, 12, 15, 18];
// Convert arrays to comma-separated lists for SQL IN clauses
categoryIDList = ArrayToList(selectedCategoryIDs, ",");
brandIDList = ArrayToList(selectedBrandIDs, ",");
priceRangeList = ArrayToList(selectedPriceRanges, ",");
regionIDList = ArrayToList(selectedRegionIDs, ",");
// Build dynamic SQL queries
productQuery = "SELECT p.id, p.name, p.price, c.categoryName, b.brandName " &
"FROM products p " &
"JOIN categories c ON p.categoryID = c.id " &
"JOIN brands b ON p.brandID = b.id " &
"WHERE p.categoryID IN (" & categoryIDList & ") " &
"AND p.brandID IN (" & brandIDList & ") " &
"AND p.isActive = 1 " &
"ORDER BY p.name";
salesAnalyticsQuery = "SELECT r.regionName, SUM(s.amount) as totalSales, " &
"COUNT(s.id) as orderCount, AVG(s.amount) as avgOrder " &
"FROM sales s " &
"JOIN regions r ON s.regionID = r.id " &
"WHERE s.regionID IN (" & regionIDList & ") " &
"AND s.saleDate >= '2024-01-01' " &
"GROUP BY r.regionName " &
"ORDER BY totalSales DESC";
inventoryQuery = "SELECT i.productID, p.name, i.quantity, i.warehouseID " &
"FROM inventory i " &
"JOIN products p ON i.productID = p.id " &
"WHERE p.categoryID IN (" & categoryIDList & ") " &
"AND i.quantity > 0 " &
"ORDER BY i.quantity DESC";
</cfscript>
<cfoutput>
<h2>🔍 Dynamic Query Generation</h2>
<div style="background: ##f8f9fa; padding: 15px; border-radius: 5px; margin: 15px 0;">
<h3>🔧 ArrayToList Implementation:</h3>
<div style="background: white; padding: 15px; border-radius: 3px; font-family: monospace; font-size: 1.1em;">
categoryIDs = ArrayToList(selectedCategories, ",");<br>
sql = "SELECT * FROM products WHERE categoryID IN (" + categoryIDs + ")";
</div>
<h3>📊 Filter Analysis:</h3>
<div style="display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 15px; margin: 20px 0;">
<div style="background: white; padding: 15px; border-radius: 5px; border-left: 4px solid ##28a745;">
<h4 style="margin-top: 0; color: ##28a745;">📦 Categories</h4>
<p><strong>Selected:</strong> #ArrayLen(selectedCategoryIDs)# categories</p>
<div style="background: ##f8f9fa; padding: 8px; border-radius: 3px; font-size: 0.9em;">
<strong>IDs:</strong> #categoryIDList#
</div>
</div>
<div style="background: white; padding: 15px; border-radius: 5px; border-left: 4px solid ##17a2b8;">
<h4 style="margin-top: 0; color: ##17a2b8;">🏷️ Brands</h4>
<p><strong>Selected:</strong> #ArrayLen(selectedBrandIDs)# brands</p>
<div style="background: ##f8f9fa; padding: 8px; border-radius: 3px; font-size: 0.9em;">
<strong>IDs:</strong> #brandIDList#
</div>
</div>
<div style="background: white; padding: 15px; border-radius: 5px; border-left: 4px solid ##fd7e14;">
<h4 style="margin-top: 0; color: ##fd7e14;">💰 Price Ranges</h4>
<p><strong>Selected:</strong> #ArrayLen(selectedPriceRanges)# ranges</p>
<div style="background: ##f8f9fa; padding: 8px; border-radius: 3px; font-size: 0.9em;">
<strong>Range IDs:</strong> #priceRangeList#
</div>
</div>
<div style="background: white; padding: 15px; border-radius: 5px; border-left: 4px solid ##6f42c1;">
<h4 style="margin-top: 0; color: ##6f42c1;">🌍 Regions</h4>
<p><strong>Selected:</strong> #ArrayLen(selectedRegionIDs)# regions</p>
<div style="background: ##f8f9fa; padding: 8px; border-radius: 3px; font-size: 0.9em;">
<strong>IDs:</strong> #regionIDList#
</div>
</div>
</div>
<h3>🔍 Generated SQL Queries:</h3>
<div style="background: ##fff3cd; padding: 15px; border-radius: 5px; margin: 15px 0;">
<h4>🛍️ Product Search Query:</h4>
<div style="background: white; padding: 12px; border-radius: 3px; font-family: monospace; font-size: 0.85em; overflow-x: auto; white-space: pre-wrap;">#productQuery#</div>
<div style="margin-top: 10px; padding: 8px; background: ##d4edda; border-radius: 3px; font-size: 0.9em;">
<strong>✅ Business Value:</strong> Finds products matching user's category and brand preferences
</div>
</div>
<div style="background: ##e8f4f8; padding: 15px; border-radius: 5px; margin: 15px 0;">
<h4>📊 Sales Analytics Query:</h4>
<div style="background: white; padding: 12px; border-radius: 3px; font-family: monospace; font-size: 0.85em; overflow-x: auto; white-space: pre-wrap;">#salesAnalyticsQuery#</div>
<div style="margin-top: 10px; padding: 8px; background: ##d4edda; border-radius: 3px; font-size: 0.9em;">
<strong>✅ Business Value:</strong> Analyzes sales performance across selected regions
</div>
</div>
<div style="background: ##f8d7da; padding: 15px; border-radius: 5px; margin: 15px 0;">
<h4>📦 Inventory Query:</h4>
<div style="background: white; padding: 12px; border-radius: 3px; font-family: monospace; font-size: 0.85em; overflow-x: auto; white-space: pre-wrap;">#inventoryQuery#</div>
<div style="margin-top: 10px; padding: 8px; background: ##d4edda; border-radius: 3px; font-size: 0.9em;">
<strong>✅ Business Value:</strong> Checks stock levels for products in selected categories
</div>
</div>
<h3>🛡️ Secure Implementation Examples:</h3>
<div style="background: ##d4edda; padding: 15px; border-radius: 5px; margin: 15px 0;">
<h4>✅ Parameterized Query (Recommended):</h4>
<div style="background: white; padding: 12px; border-radius: 3px; font-family: monospace; font-size: 0.9em;">
<cfscript>
// Build parameter placeholders for security
placeholders = [];
for (i = 1; i LTE ArrayLen(selectedCategoryIDs); i++) {
ArrayAppend(placeholders, "?");
}
placeholderList = ArrayToList(placeholders, ",");
</cfscript>
<cfquery name="secureProductQuery" datasource="myDB"><br>
SELECT p.id, p.name, p.price, c.categoryName<br>
FROM products p<br>
JOIN categories c ON p.categoryID = c.id<br>
WHERE p.categoryID IN (#placeholderList#)<br>
AND p.isActive = 1<br>
<br>
<cfloop array="##selectedCategoryIDs##" index="categoryID"><br>
<cfqueryparam value="##categoryID##" cfsqltype="cf_sql_integer"><br>
</cfloop><br>
</cfquery>
</div>
<div style="margin-top: 10px; padding: 8px; background: ##28a745; color: white; border-radius: 3px; font-size: 0.9em;">
<strong>🛡️ Security Benefit:</strong> Prevents SQL injection attacks while maintaining dynamic functionality
</div>
</div>
<h3>⚡ Performance Optimization:</h3>
<cfscript>
// Performance comparison data
filterCount = ArrayLen(selectedCategoryIDs) + ArrayLen(selectedBrandIDs) + ArrayLen(selectedRegionIDs);
// Simulated performance metrics
inClauseTime = "2.3ms";
orConditionTime = "15.7ms";
performanceGain = "85%";
</cfscript>
<div style="background: ##f0f8ff; padding: 15px; border-radius: 5px;">
<h4>📈 Query Performance Comparison:</h4>
<div style="display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin: 15px 0;">
<div>
<h5 style="color: ##28a745;">✅ Using IN Clause (ArrayToList)</h5>
<div style="background: white; padding: 10px; border-radius: 3px; font-family: monospace; font-size: 0.85em;">
WHERE categoryID IN (#categoryIDList#)
</div>
<p><strong>Execution Time:</strong> <span style="color: ##28a745; font-weight: bold;">#inClauseTime#</span></p>
<p><strong>Query Complexity:</strong> Simple</p>
<p><strong>Index Usage:</strong> Optimal</p>
</div>
<div>
<h5 style="color: ##dc3545;">❌ Using Multiple OR Conditions</h5>
<div style="background: white; padding: 10px; border-radius: 3px; font-family: monospace; font-size: 0.85em;">
WHERE categoryID = 101 OR categoryID = 205<br>
OR categoryID = 312 OR categoryID = 487...
</div>
<p><strong>Execution Time:</strong> <span style="color: ##dc3545; font-weight: bold;">#orConditionTime#</span></p>
<p><strong>Query Complexity:</strong> High</p>
<p><strong>Index Usage:</strong> Inefficient</p>
</div>
</div>
<div style="background: ##28a745; color: white; padding: 10px; border-radius: 3px; text-align: center; font-weight: bold;">
Performance Improvement: #performanceGain# faster with ArrayToList + IN clause
</div>
</div>
<h3>🎯 Real-World Application Examples:</h3>
<div style="display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 15px; margin: 20px 0;">
<div style="background: white; padding: 15px; border-radius: 5px; border-left: 4px solid ##28a745;">
<h4 style="margin-top: 0;">🛒 E-Commerce Product Filtering</h4>
<p><strong>Use Case:</strong> Customer filters products by multiple categories, brands, and price ranges</p>
<p><strong>Benefit:</strong> Fast, dynamic product search with complex criteria</p>
<div style="background: ##f8f9fa; padding: 8px; border-radius: 3px; font-size: 0.85em;">
<strong>Implementation:</strong> Convert user selections to IN clauses for efficient filtering
</div>
</div>
<div style="background: white; padding: 15px; border-radius: 5px; border-left: 4px solid ##17a2b8;">
<h4 style="margin-top: 0;">📊 Business Intelligence Reporting</h4>
<p><strong>Use Case:</strong> Generate reports for selected regions, departments, or time periods</p>
<p><strong>Benefit:</strong> Flexible, user-driven analytics with optimal query performance</p>
<div style="background: ##f8f9fa; padding: 8px; border-radius: 3px; font-size: 0.85em;">
<strong>Implementation:</strong> Dynamic report queries based on user dashboard selections
</div>
</div>
<div style="background: white; padding: 15px; border-radius: 5px; border-left: 4px solid ##fd7e14;">
<h4 style="margin-top: 0;">👥 User Permission Management</h4>
<p><strong>Use Case:</strong> Check user access rights across multiple resources or departments</p>
<p><strong>Benefit:</strong> Efficient permission validation with scalable architecture</p>
<div style="background: ##f8f9fa; padding: 8px; border-radius: 3px; font-size: 0.85em;">
<strong>Implementation:</strong> Convert permission arrays to access control queries
</div>
</div>
</div>
<h3>📈 Query Performance Metrics:</h3>
<div style="background: ##e8f5e8; padding: 15px; border-radius: 5px;">
<div style="display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 15px;">
<div style="background: white; padding: 15px; border-radius: 5px; text-align: center;">
<h3 style="margin: 0; color: ##28a745;">#filterCount#</h3>
<p style="margin: 5px 0 0 0;">Active Filters</p>
</div>
<div style="background: white; padding: 15px; border-radius: 5px; text-align: center;">
<h3 style="margin: 0; color: ##17a2b8;">3</h3>
<p style="margin: 5px 0 0 0;">Query Types</p>
</div>
<div style="background: white; padding: 15px; border-radius: 5px; text-align: center;">
<h3 style="margin: 0; color: ##fd7e14;"><3ms</h3>
<p style="margin: 5px 0 0 0;">Avg Query Time</p>
</div>
<div style="background: white; padding: 15px; border-radius: 5px; text-align: center;">
<h3 style="margin: 0; color: ##6f42c1;">85%</h3>
<p style="margin: 5px 0 0 0;">Performance Gain</p>
</div>
</div>
</div>
</div>
</cfoutput>
Form processing and multi-select handling
HR systems and web applications process multi-select form fields for employee skills, product configurations, and survey responses requiring efficient database storage. Form arrays cannot be stored directly in database fields. Complex parsing logic for display formatting creates inconsistent data handling across applications with 50% processing error rates. Use ArrayToList to standardize multi-select data conversion for storage, display, and export across all form types.
<cfscript>
// Simulated form submission data (typically from form.fieldName arrays)
// Employee skills selection form
employeeSkills = ["JavaScript", "ColdFusion", "SQL", "HTML/CSS", "React", "Node.js", "Python"];
// Product configuration form
productFeatures = ["WiFi", "Bluetooth", "GPS", "4K Display", "Waterproof", "Fast Charging"];
// Survey response form
surveyAnswers = ["Excellent Service", "Good Value", "Timely Delivery", "Professional Staff"];
// User preferences form
notificationTypes = ["Email Alerts", "SMS Updates", "Push Notifications", "Weekly Newsletter"];
// Project collaboration form
teamMemberRoles = ["Project Manager", "Developer", "Designer", "QA Tester", "Business Analyst"];
</cfscript>
<cfoutput>
<h2>📋 Multi-Select Form Processing</h2>
<div style="background: ##f8f9fa; padding: 15px; border-radius: 5px; margin: 15px 0;">
<h3>🔧 ArrayToList Implementation:</h3>
<div style="background: white; padding: 15px; border-radius: 3px; font-family: monospace; font-size: 1.1em;">
selectedSkills = ArrayToList(form.skills, "|");<br>
// Store pipe-delimited string in database
</div>
<cfscript>
// Convert form arrays to database-friendly formats
skillsList = ArrayToList(employeeSkills, "|");
featuresList = ArrayToList(productFeatures, ",");
answersList = ArrayToList(surveyAnswers, ";");
notificationsList = ArrayToList(notificationTypes, "||");
rolesList = ArrayToList(teamMemberRoles, ",");
// For user-friendly display formats
skillsDisplay = ArrayToList(employeeSkills, " • ");
featuresDisplay = ArrayToList(productFeatures, ", ");
answersDisplay = ArrayToList(surveyAnswers, " | ");
// For CSV export compatibility
skillsCSV = ArrayToList(employeeSkills, ",");
featuresCSV = ArrayToList(productFeatures, ",");
// Calculate form statistics
totalSkills = ArrayLen(employeeSkills);
totalFeatures = ArrayLen(productFeatures);
totalAnswers = ArrayLen(surveyAnswers);
totalNotifications = ArrayLen(notificationTypes);
totalRoles = ArrayLen(teamMemberRoles);
</cfscript>
<h3>📊 Form Processing Results:</h3>
<div style="display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 15px; margin: 20px 0;">
<div style="background: white; padding: 15px; border-radius: 5px; border-left: 4px solid ##28a745;">
<h4 style="margin-top: 0; color: ##28a745;">👨💻 Employee Skills Form</h4>
<p><strong>Selected Skills:</strong> #totalSkills#</p>
<div style="background: ##f8f9fa; padding: 10px; border-radius: 3px; margin: 8px 0;">
<strong>Database Format (Pipe):</strong><br>
<code style="font-size: 0.85em; word-break: break-all;">#skillsList#</code>
</div>
<div style="background: ##e8f5e8; padding: 10px; border-radius: 3px; margin: 8px 0;">
<strong>Display Format:</strong><br>
<span style="font-size: 0.9em;">#skillsDisplay#</span>
</div>
</div>
<div style="background: white; padding: 15px; border-radius: 5px; border-left: 4px solid ##17a2b8;">
<h4 style="margin-top: 0; color: ##17a2b8;">📱 Product Features Form</h4>
<p><strong>Selected Features:</strong> #totalFeatures#</p>
<div style="background: ##f8f9fa; padding: 10px; border-radius: 3px; margin: 8px 0;">
<strong>Database Format (Comma):</strong><br>
<code style="font-size: 0.85em; word-break: break-all;">#featuresList#</code>
</div>
<div style="background: ##e8f4f8; padding: 10px; border-radius: 3px; margin: 8px 0;">
<strong>Display Format:</strong><br>
<span style="font-size: 0.9em;">#featuresDisplay#</span>
</div>
</div>
<div style="background: white; padding: 15px; border-radius: 5px; border-left: 4px solid ##fd7e14;">
<h4 style="margin-top: 0; color: ##fd7e14;">📋 Survey Responses Form</h4>
<p><strong>Selected Answers:</strong> #totalAnswers#</p>
<div style="background: ##f8f9fa; padding: 10px; border-radius: 3px; margin: 8px 0;">
<strong>Database Format (Semicolon):</strong><br>
<code style="font-size: 0.85em; word-break: break-all;">#answersList#</code>
</div>
<div style="background: ##fff3cd; padding: 10px; border-radius: 3px; margin: 8px 0;">
<strong>Display Format:</strong><br>
<span style="font-size: 0.9em;">#answersDisplay#</span>
</div>
</div>
</div>
<h3>💾 Database Storage Examples:</h3>
<div style="background: ##d4edda; padding: 15px; border-radius: 5px; margin: 15px 0;">
<h4>🗄️ Employee Skills Table:</h4>
<div style="background: white; padding: 12px; border-radius: 3px; font-family: monospace; font-size: 0.9em; overflow-x: auto;">
INSERT INTO employees (<br>
employee_id, name, department, skills, date_updated<br>
) VALUES (<br>
1001, 'John Doe', 'IT', '#skillsList#', NOW()<br>
);
</div>
<div style="margin-top: 10px; padding: 8px; background: ##28a745; color: white; border-radius: 3px; font-size: 0.9em;">
<strong>✅ Storage Benefit:</strong> Single field stores multiple skills, easy to query and update
</div>
</div>
<div style="background: ##cce5f4; padding: 15px; border-radius: 5px; margin: 15px 0;">
<h4>📦 Product Configuration Table:</h4>
<div style="background: white; padding: 12px; border-radius: 3px; font-family: monospace; font-size: 0.9em; overflow-x: auto;">
INSERT INTO product_configurations (<br>
config_id, product_id, selected_features, total_price, created_date<br>
) VALUES (<br>
5001, 'PROD-2024-001', '#featuresList#', 1299.99, NOW()<br>
);
</div>
<div style="margin-top: 10px; padding: 8px; background: ##17a2b8; color: white; border-radius: 3px; font-size: 0.9em;">
<strong>✅ Business Value:</strong> Track customer preferences and custom product configurations
</div>
</div>
<div style="background: ##fff3cd; padding: 15px; border-radius: 5px; margin: 15px 0;">
<h4>📊 Survey Responses Table:</h4>
<div style="background: white; padding: 12px; border-radius: 3px; font-family: monospace; font-size: 0.9em; overflow-x: auto;">
INSERT INTO survey_responses (<br>
response_id, survey_id, user_id, selected_answers, completion_date<br>
) VALUES (<br>
3001, 'SURVEY-2024-Q4', 'USER-12345', '#answersList#', NOW()<br>
);
</div>
<div style="margin-top: 10px; padding: 8px; background: ##fd7e14; color: white; border-radius: 3px; font-size: 0.9em;">
<strong>✅ Analytics Value:</strong> Enable multi-response analysis and customer satisfaction tracking
</div>
</div>
<h3>🔄 Data Retrieval & Processing:</h3>
<div style="background: ##f8f9fa; padding: 15px; border-radius: 5px;">
<h4>📤 Converting Back to Arrays (ListToArray):</h4>
<div style="background: white; padding: 12px; border-radius: 3px; font-family: monospace; font-size: 0.9em;">
// Retrieve stored skills from database<br>
storedSkills = "#skillsList#";<br>
<br>
// Convert back to array for processing<br>
skillsArray = ListToArray(storedSkills, "|");<br>
<br>
// Loop through individual skills<br>
for (skill in skillsArray) {<br>
WriteOutput("Skill: " & skill & "<br>");<br>
}
</div>
<h4>🔍 Searching Stored Lists:</h4>
<div style="background: white; padding: 12px; border-radius: 3px; font-family: monospace; font-size: 0.9em;">
// Find employees with specific skills<br>
SELECT employee_id, name, skills<br>
FROM employees<br>
WHERE skills LIKE '%JavaScript%'<br>
OR skills LIKE '%ColdFusion%'<br>
OR skills LIKE '%Python%';
</div>
<h4>📊 Analytics Queries:</h4>
<div style="background: white; padding: 12px; border-radius: 3px; font-family: monospace; font-size: 0.9em;">
// Count most popular skills<br>
SELECT<br>
SUM(CASE WHEN skills LIKE '%JavaScript%' THEN 1 ELSE 0 END) as javascript_count,<br>
SUM(CASE WHEN skills LIKE '%ColdFusion%' THEN 1 ELSE 0 END) as coldfusion_count,<br>
SUM(CASE WHEN skills LIKE '%SQL%' THEN 1 ELSE 0 END) as sql_count<br>
FROM employees;
</div>
</div>
<h3>🎨 User Interface Examples:</h3>
<div style="display: grid; grid-template-columns: repeat(auto-fit, minmax(350px, 1fr)); gap: 15px; margin: 20px 0;">
<div style="background: white; padding: 15px; border-radius: 5px; border: 1px solid ##e9ecef;">
<h4>📝 HTML Multi-Select Form:</h4>
<div style="background: ##f8f9fa; padding: 12px; border-radius: 3px; font-family: monospace; font-size: 0.85em;">
<form method="post"><br>
<label>Select Your Skills:</label><br>
<select name="skills" multiple size="5"><br>
<option value="JavaScript">JavaScript</option><br>
<option value="ColdFusion">ColdFusion</option><br>
<option value="SQL">SQL</option><br>
<option value="Python">Python</option><br>
</select><br>
<input type="submit" value="Submit"><br>
</form>
</div>
</div>
<div style="background: white; padding: 15px; border-radius: 5px; border: 1px solid ##e9ecef;">
<h4>✅ ColdFusion Processing:</h4>
<div style="background: ##f8f9fa; padding: 12px; border-radius: 3px; font-family: monospace; font-size: 0.85em;">
<cfif structKeyExists(form, "skills")><br>
<cfscript><br>
// Convert form array to list<br>
skillsList = ArrayToList(form.skills, "|");<br>
<br>
// Save to database<br>
// queryExecute("INSERT INTO...");<br>
</cfscript><br>
</cfif>
</div>
</div>
</div>
<h3>📈 Form Processing Statistics:</h3>
<div style="background: ##e8f5e8; padding: 15px; border-radius: 5px;">
<div style="display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 15px;">
<div style="background: white; padding: 15px; border-radius: 5px; text-align: center;">
<h3 style="margin: 0; color: ##28a745;">#totalSkills + totalFeatures + totalAnswers#</h3>
<p style="margin: 5px 0 0 0;">Total Selections</p>
</div>
<div style="background: white; padding: 15px; border-radius: 5px; text-align: center;">
<h3 style="margin: 0; color: ##17a2b8;">5</h3>
<p style="margin: 5px 0 0 0;">Form Types</p>
</div>
<div style="background: white; padding: 15px; border-radius: 5px; text-align: center;">
<h3 style="margin: 0; color: ##fd7e14;"><1ms</h3>
<p style="margin: 5px 0 0 0;">Processing Time</p>
</div>
<div style="background: white; padding: 15px; border-radius: 5px; text-align: center;">
<h3 style="margin: 0; color: ##6f42c1;">100%</h3>
<p style="margin: 5px 0 0 0;">Data Integrity</p>
</div>
</div>
</div>
<h3>🌐 Different Delimiter Use Cases:</h3>
<div style="background: ##f0f8ff; padding: 15px; border-radius: 5px;">
<h4>🎯 Delimiter Selection Guide:</h4>
<div style="display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 15px; margin: 15px 0;">
<div style="background: white; padding: 10px; border-radius: 3px; border-left: 3px solid ##28a745;">
<h5 style="margin-top: 0;">📊 Comma (,)</h5>
<p><strong>Best For:</strong> CSV exports, email lists</p>
<p><strong>Example:</strong> JavaScript,SQL,Python</p>
<p><strong>Risk:</strong> Conflicts if data contains commas</p>
</div>
<div style="background: white; padding: 10px; border-radius: 3px; border-left: 3px solid ##17a2b8;">
<h5 style="margin-top: 0;">📝 Pipe (|)</h5>
<p><strong>Best For:</strong> Database storage, internal processing</p>
<p><strong>Example:</strong> JavaScript|SQL|Python</p>
<p><strong>Benefit:</strong> Rare in user data, database-friendly</p>
</div>
<div style="background: white; padding: 10px; border-radius: 3px; border-left: 3px solid ##fd7e14;">
<h5 style="margin-top: 0;">🔧 Semicolon (;)</h5>
<p><strong>Best For:</strong> European CSV, configuration files</p>
<p><strong>Example:</strong> JavaScript;SQL;Python</p>
<p><strong>Use Case:</strong> International compatibility</p>
</div>
<div style="background: white; padding: 10px; border-radius: 3px; border-left: 3px solid ##6f42c1;">
<h5 style="margin-top: 0;">💫 Custom (• | )</h5>
<p><strong>Best For:</strong> User display, reports</p>
<p><strong>Example:</strong> JavaScript • SQL • Python</p>
<p><strong>Benefit:</strong> Professional appearance, readable</p>
</div>
</div>
</div>
</div>
</cfoutput>
