If you’ve spent any time in ColdFusion, you’ve probably bumped into “lists.” They show up in form scopes, configuration options, and lots of legacy code. But lists in Adobe ColdFusion are more than just random strings with commas in them. They’re first-class data structures with a surprising amount of power behind them.

At their core, ColdFusion lists are still just strings. The difference is that ColdFusion treats those strings as delimited collections of values and gives you a dedicated toolbox of list functions to work with them. Under the hood, a list is “flat”, you don’t get true multi-dimensional lists the way you do with arrays. But you can still build “lists of lists” and manipulate them if you’re careful.

What makes lists special in CF is the ecosystem around them. Instead of manually calling split() and pushing values into an array like you might in Java, JavaScript, or C#, ColdFusion gives you dozens of built-in list functions that understand delimiters, positions, and membership. That means you can often work directly with the list string instead of converting it into a different structure for every little operation.

The foundation of a list is simple: you have a series of items (numbers, words, filenames, whatever) and a delimiter between them. By default, ColdFusion assumes that delimiter is a comma. If your data is comma-separated, you don’t have to specify anything special, the list functions just work. But if your delimiter is something else (a pipe, a dot, a semicolon, etc.), you need to tell those functions which character you’re using, or you’ll get very confusing results.

On top of that, there’s an important distinction between delimitation and demarcation. Lists are delimited: the delimiter appears between items. JSON and XML, on the other hand, wrap their elements with structural markers (braces, brackets, tags) that can contain their own delimiters inside. That means JSON objects may look “list-y” at a glance, but they aren’t lists, and trying to treat them like lists will go sideways quickly. Use proper serialization functions to move between JSON and other structures rather than clever find/replace tricks.

ColdFusion’s list functions roughly fall into a few categories. First are the “builder” functions: things like listAppend, listPrepend, and listInsertAt that help you add items, and listDeleteAt, listSetAt, and listChangeDelims that let you remove, replace, or change how the list is delimited. These functions understand list positions (starting at 1, not 0), and ColdFusion will handle shifting everything around for you when you insert or delete items at a specific index.

Then you have the “getter” and metadata helpers: listFirst, listLast, listGetAt, listRest, and listLen. These make it easy to grab the first item, the last item, a specific index, “everything but the first,” or just get a count of how many elements you’re dealing with. They’re handy for things like pulling file extensions from a filename (listLast with a dot delimiter) or looping from 1 to listLen() when you want direct control over iteration.

Next come the searching and filtering tools. listFind and listFindNoCase tell you whether a specific value exists in the list and, if so, at which position. listContains and listContainsNoCase look for substrings inside list items, which is great for things like “does any filename contain config or .js?”

Functions like listFilter and listMap go a step further: they let you pass in a callback to keep only items that match some rule, or to transform every item into a new value (e.g., uppercasing every word, doubling every numeric value, or cleaning up messy text before you store it).

So when should you use lists? They’re fantastic for simple, predictable scenarios: looping over form field names that can’t contain commas, counting items that you know are safely delimited, or throwing together quick prototypes where you just need “a bunch of values” wired up quickly. They’re also useful as intermediate structures when piping data from one system to another: grab the list, do a quick length check, maybe filter or map, and pass it along. Just remember that a non-delimited string is effectively treated as a list with a single element at position 1, which can surprise you when you’re checking lengths or iterating.

However, lists can turn into an anti-pattern when things get complex. If you find yourself juggling nested lists (“lists of lists”), switching delimiters multiple times, or inventing “clever delimiters” like spaces inside a full name field, that’s usually a sign you should promote your data to a richer structure like an array, struct, or JSON. The classic example is splitting a full name on a single space: it works until you get names like “Mary Kate”, “Van der Meer”, or anything with suffixes like “Jr.”; suddenly your ETL pipeline is mangling people’s names in ways that are hard to detect and fix.

The bottom line: treat ColdFusion lists as a fast, lightweight tool, not as a universal data model. Use the built-in list functions when your data is simple, your delimiters are well-defined, and you need to move quickly. As soon as you feel yourself wrestling with delimiters, edge cases, or multi-dimensional data, that’s your cue to refactor into arrays, structs, or JSON. In the accompanying video and code samples, we’ll walk through concrete examples of these functions in action so you can see exactly where lists shine, and where it’s smarter to reach for something more robust.

If this has whet your appetite for learning more about the built-in functions in Adobe ColdFusion for lists, check out my hour-long webinar where I share details and code samples here:
https://www.youtube.com/watch?v=LpokGqYOT9w&pp=2AYDhttps://www.youtube.com/watch?v=LpokGqYOT9w&pp=2AYD

I also have all of the code samples and “List Factory” app on my GitHub here: 
https://github.com/AdobeColdFusion/webinars/tree/main/listshttps://github.com/AdobeColdFusion/webinars/tree/main/lists

All Comments
Sort by:  Most Recent