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

ListFindNoCase

Last update:
May 18, 2026

Description

Determines the index of the first list element in which a specified value occurs.

Returns

Index of the first list element that contains value. If not found, returns zero. The search is case-insensitive.
History
ColdFusion (2018 release): Introduced named parameters.

Category

Function syntax

ListFindNoCase(list, value [, delimiters, includeEmptyFields ])

See also

ListContainsListFindLists in Data types- Developing guide in the Developing ColdFusion Applications

Parameters

Parameter
Description
includeEmptyValues
Optional. Set to yes to include empty values.
list
A list or a variable that contains one.
value
Number or string for which to search. The search is case-insensitive.
delimiters
A string or a variable that contains one. Characters that separate list elements. The default value is comma. If this parameter contains more than one character, ColdFusion processes each occurrence of each character as a delimiter.

Usage

ColdFusion ignores empty list elements; thus, the list "a,b,c,,,d" has four elements.

Example

<cfscript>
       myList="Tokyo,Bangkok,bangkok,bangKok,Jakarta,Manila,Bangalore,Shanghai";
       myFind=ListFindNoCase(myList,"bangkok");
       WriteOutput(myFind); // Returns 2
</cfscript>
Output
2

Real-world uses of the ListFindNoCase function

User search and auto-complete systems

A customer support portal with a comprehensive knowledge base serves 10,000+ users who search for solutions using natural language queries. Users often type search terms in varying cases (uppercase, lowercase, mixed case), and the system needs to provide consistent, accurate results regardless of how users format their search terms.
How it helps:
  • Increase in successful search results through case flexibility
  • Users find information faster regardless of typing style
  • Fewer support requests
  • More content discovered through flexible matching
<cfscript>
    // Simple Knowledge Base Search with ListFindNoCase
    // Business: Customer support portal with case-insensitive help topic search
    
    // Available help topics (standardized format)
    helpTopics = "Installation,Configuration,Troubleshooting,API,Database,Security,Performance";
    
    // User searches (various case formats from different interfaces)
    userSearches = [
        {"query": "installation", "user": "Mobile User"},
        {"query": "API", "user": "Developer"},
        {"query": "database", "user": "Admin"},
        {"query": "SECURITY", "user": "Manager"},
        {"query": "troubleshooting", "user": "Support Agent"}
    ];
    
    // Auto-suggest function
    function getHelpSuggestions(searchTerm, topicList) {
        local.suggestions = [];
        local.topicArray = ListToArray(topicList);
        
        for (local.topic in local.topicArray) {
            if (FindNoCase(searchTerm, local.topic) > 0) {
                ArrayAppend(local.suggestions, local.topic);
            }
        }
        return local.suggestions;
    }
</cfscript>

<cfoutput>
    <h1>📚 ListFindNoCase: Knowledge Base Search Demo</h1>
    <p><strong>Business Need:</strong> Help users find support articles regardless of how they type search terms</p>
    <p><strong>Challenge:</strong> Users type in different cases - "api", "API", "Api" should all work</p>
    <p><strong>Solution:</strong> Use ListFindNoCase() for flexible topic matching</p>
    <hr>
    
    <h2>Available Help Topics</h2>
    <div style="background: ##f8f9fa; padding: 15px; border: 1px solid ##ddd; margin: 10px 0;">
        <p><strong>Topics:</strong> #helpTopics#</p>
        <p><em>Users can search for any topic using any capitalization</em></p>
    </div>
    
    <h2>User Search Results</h2>
</cfoutput>

<cfloop array="#userSearches#" index="search">
    <cfscript>
        // Use ListFindNoCase for exact topic matching
        topicPosition = ListFindNoCase(helpTopics, search["query"]);
        isExactMatch = topicPosition > 0;
        
        // Get auto-suggest results for partial matches
        suggestions = getHelpSuggestions(search["query"], helpTopics);
    </cfscript>

    <cfoutput>
        <div style="background: #isExactMatch ? '##d4edda' : (ArrayLen(suggestions) GT 0 ? '##fff3cd' : '##f8d7da')#; padding: 15px; margin: 10px 0; border-radius: 5px;">
            <h3>#search["user"]# searches for: "#search["query"]#"</h3>
            
            <cfif isExactMatch>
                <p>✅ <strong>Exact Topic Match Found!</strong></p>
                <p>Topic: <strong>#ListGetAt(helpTopics, topicPosition)#</strong></p>
                <p>Position in List: #topicPosition#</p>
                <p>🔗 <em>Redirecting to help article...</em></p>
            <cfelseif ArrayLen(suggestions) GT 0>
                <p>📝 <strong>Similar Topics Available:</strong></p>
                <p>Suggestions: <strong>#ArrayToList(suggestions)#</strong></p>
                <p>💡 <em>Did you mean one of these topics?</em></p>
            <cfelse>
                <p>❌ <strong>No matches found</strong></p>
                <p>Try searching for: Installation, Configuration, Troubleshooting, API, Database, Security, or Performance</p>
            </cfif>
        </div>
    </cfoutput>
</cfloop>

<cfscript>
    // Calculate search success statistics
    exactMatches = 0;
    partialMatches = 0;
    noMatches = 0;
    
    for (search in userSearches) {
        topicFound = ListFindNoCase(helpTopics, search["query"]) > 0;
        suggestions = getHelpSuggestions(search["query"], helpTopics);
        
        if (topicFound) {
            exactMatches++;
        } else if (ArrayLen(suggestions) > 0) {
            partialMatches++;
        } else {
            noMatches++;
        }
    }
    
    totalSearches = ArrayLen(userSearches);
    successRate = totalSearches > 0 ? Round(((exactMatches + partialMatches) / totalSearches) * 100) : 0;
</cfscript>

<cfoutput>
    <h2>📊 Search Analytics</h2>
    <div style="display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 15px; margin: 20px 0;">
        <div style="background: ##e8f5e8; padding: 15px; text-align: center; border-radius: 5px;">
            <h3>Exact Matches</h3>
            <h2 style="color: green;">#exactMatches#</h2>
        </div>
        <div style="background: ##fff8dc; padding: 15px; text-align: center; border-radius: 5px;">
            <h3>Partial Matches</h3>
            <h2 style="color: orange;">#partialMatches#</h2>
        </div>
        <div style="background: ##ffe4e1; padding: 15px; text-align: center; border-radius: 5px;">
            <h3>No Matches</h3>
            <h2 style="color: red;">#noMatches#</h2>
        </div>
        <div style="background: ##e3f2fd; padding: 15px; text-align: center; border-radius: 5px;">
            <h3>Success Rate</h3>
            <h2 style="color: blue;">#successRate#%</h2>
        </div>
    </div>
</cfoutput>

eCommerce product search and category navigation

An online retail platform with 500,000+ products uses tag-based categorization and search filtering. Customers search using natural language with varying capitalization, and the system must provide accurate product matches regardless of how search terms are formatted, ensuring optimal shopping experience and conversion rates.
<cfscript>
    // Simple E-Commerce Category Filter with ListFindNoCase
    // Business: Online store with case-insensitive product category filtering
    
    // Available product categories (standardized format)
    categories = "Electronics,Fashion,Home,Sports,Books,Automotive,Health,Beauty";
    
    // Customer filter selections (various cases from different interfaces)
    customerFilters = [
        {"filter": "electronics", "source": "Mobile App", "customer": "John Smith"},
        {"filter": "FASHION", "source": "Desktop (Caps Lock)", "customer": "Mary Johnson"},
        {"filter": "Home", "source": "Voice Search", "customer": "Alex Chen"},
        {"filter": "sports", "source": "Search Bar", "customer": "Sarah Wilson"},
        {"filter": "BEAUTY", "source": "Category Menu", "customer": "Mike Brown"}
    ];
    
    // Function to simulate product counts per category
    function getProductCount(categoryName) {
        switch(categoryName) {
            case "Electronics": return 1247;
            case "Fashion": return 892;
            case "Home": return 634;
            case "Sports": return 456;
            case "Books": return 2145;
            case "Automotive": return 378;
            case "Health": return 523;
            case "Beauty": return 689;
            default: return 0;
        }
    }
</cfscript>

<cfoutput>
    <h1>🛍️ ListFindNoCase: E-Commerce Category Filter Demo</h1>
    <p><strong>Business Need:</strong> Allow customers to filter products by category regardless of typing case</p>
    <p><strong>Challenge:</strong> Mobile auto-capitalize, caps lock, and different typing styles create case variations</p>
    <p><strong>Solution:</strong> Use ListFindNoCase() for flexible category matching</p>
    <hr>
    
    <h2>Available Product Categories</h2>
    <div style="background: ##f8f9fa; padding: 15px; border: 1px solid ##ddd; margin: 10px 0;">
        <p><strong>Categories:</strong> #categories#</p>
        <p><em>Customers can filter by any category name using any capitalization</em></p>
    </div>
    
    <h2>Customer Filter Processing</h2>
</cfoutput>

<cfloop array="#customerFilters#" index="customerFilter">
    <cfscript>
        // Use ListFindNoCase to validate category filter
        categoryPosition = ListFindNoCase(categories, customerFilter["filter"]);
        isValidCategory = categoryPosition > 0;
        
        if (isValidCategory) {
            // Get properly formatted category name and product count
            properCategoryName = ListGetAt(categories, categoryPosition);
            productCount = getProductCount(properCategoryName);
        } else {
            properCategoryName = "";
            productCount = 0;
        }
    </cfscript>

    <cfoutput>
        <div style="background: #isValidCategory ? '##d4edda' : '##f8d7da'#; padding: 15px; margin: 10px 0; border-radius: 5px;">
            <h3>🛒 Customer: #customerFilter["customer"]#</h3>
            <p><strong>Platform:</strong> #customerFilter["source"]#</p>
            <p><strong>Filter Input:</strong> "#customerFilter["filter"]#"</p>
            
            <cfif isValidCategory>
                <p>✅ <strong>Valid Category Filter!</strong></p>
                <p>Matched Category: <strong>#properCategoryName#</strong></p>
                <p>Category Position: #categoryPosition#</p>
                <p>📦 Products Available: <strong>#NumberFormat(productCount, "999,999")#</strong></p>
                <p>🎯 <em>Showing products in #properCategoryName# category...</em></p>
            <cfelse>
                <p>❌ <strong>Invalid Category Filter</strong></p>
                <p>Filter "#customerFilter["filter"]#" not found in available categories</p>
                <p>💡 <em>Showing all products instead or suggesting similar categories</em></p>
            </cfif>
        </div>
    </cfoutput>
</cfloop>

<cfscript>
    // Calculate filter processing statistics
    validFilters = 0;
    totalProducts = 0;
    
    for (filter in customerFilters) {
        position = ListFindNoCase(categories, filter["filter"]);
        if (position > 0) {
            validFilters++;
            categoryName = ListGetAt(categories, position);
            totalProducts += getProductCount(categoryName);
        }
    }
    
    totalCustomers = ArrayLen(customerFilters);
    filterSuccessRate = totalCustomers > 0 ? Round((validFilters / totalCustomers) * 100) : 0;
</cfscript>

<cfoutput>
    <h2>📊 Category Filter Analytics</h2>
    <div style="display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 15px; margin: 20px 0;">
        <div style="background: ##e8f5e8; padding: 15px; text-align: center; border-radius: 5px;">
            <h3>Total Filters</h3>
            <h2 style="color: blue;">#totalCustomers#</h2>
        </div>
        <div style="background: ##d4edda; padding: 15px; text-align: center; border-radius: 5px;">
            <h3>Valid Filters</h3>
            <h2 style="color: green;">#validFilters#</h2>
        </div>
        <div style="background: ##fff8dc; padding: 15px; text-align: center; border-radius: 5px;">
            <h3>Success Rate</h3>
            <h2 style="color: orange;">#filterSuccessRate#%</h2>
        </div>
        <div style="background: ##e3f2fd; padding: 15px; text-align: center; border-radius: 5px;">
            <h3>Products Found</h3>
            <h2 style="color: purple;">#NumberFormat(totalProducts, "999,999")#</h2>
        </div>
    </div>
    
    <h2>🎯 Real-World Category Matching</h2>
    <div style="background: ##f8f9fa; padding: 15px; border: 1px solid ##ddd; margin: 10px 0;">
        <p><strong>Common Customer Input Variations:</strong></p>
        <ul>
            <li><strong>"electronics"</strong> (lowercase) → Matches "Electronics"</li>
            <li><strong>"FASHION"</strong> (caps lock) → Matches "Fashion"</li>
            <li><strong>"Home"</strong> (proper case) → Matches "Home"</li>
            <li><strong>"sports"</strong> (mobile typing) → Matches "Sports"</li>
            <li><strong>"BEAUTY"</strong> (tablet caps) → Matches "Beauty"</li>
        </ul>
    </div>
</cfoutput>

Employee directory and access management

A multinational corporation with 50,000+ employees manages access permissions and directory searches across multiple systems. Employee names, department codes, and role assignments are entered by various HR systems and regional offices, creating case inconsistencies that must be resolved for accurate permission management and directory functionality.
How it helps:
  • Increase in successful employee searches
  • Reliability in access control decisions
  • Smooth data exchange between HR systems
  • Consistent functionality regardless of data entry variations
<cfscript>
    // Simple Employee Directory Department Search with ListFindNoCase
    // Business: Corporate directory with case-insensitive department and role lookup
    
    // Company departments (standardized format from HR system)
    companyDepartments = "Engineering,Marketing,Sales,HR,Finance,Operations,Legal,Support";
    
    // Employee roles (standard job classifications)
    employeeRoles = "Manager,Director,Analyst,Developer,Designer,Coordinator,Specialist,Associate";
    
    // Directory search requests (from various internal systems and user interfaces)
    directorySearches = [
        {"query": "engineering", "type": "department", "searcher": "New Employee", "purpose": "Team Contact"},
        {"query": "MARKETING", "type": "department", "searcher": "Project Manager", "purpose": "Collaboration"},
        {"query": "manager", "type": "role", "searcher": "HR Recruiter", "purpose": "Org Chart"},
        {"query": "DEVELOPER", "type": "role", "searcher": "Team Lead", "purpose": "Resource Planning"},
        {"query": "Sales", "type": "department", "searcher": "Partner", "purpose": "Business Contact"}
    ];
    
    // Function to simulate employee counts by department/role
    function getEmployeeCount(searchType, searchValue) {
        if (searchType == "department") {
            switch(searchValue) {
                case "Engineering": return 145;
                case "Marketing": return 32;
                case "Sales": return 67;
                case "HR": return 18;
                case "Finance": return 25;
                case "Operations": return 42;
                case "Legal": return 8;
                case "Support": return 28;
                default: return 0;
            }
        } else if (searchType == "role") {
            switch(searchValue) {
                case "Manager": return 45;
                case "Director": return 12;
                case "Analyst": return 38;
                case "Developer": return 89;
                case "Designer": return 24;
                case "Coordinator": return 16;
                case "Specialist": return 31;
                case "Associate": return 52;
                default: return 0;
            }
        }
        return 0;
    }
</cfscript>

<cfoutput>
    <h1>🏢 ListFindNoCase: Employee Directory Search Demo</h1>
    <p><strong>Business Need:</strong> Enable flexible employee directory searches by department and role</p>
    <p><strong>Challenge:</strong> Users search using different case formats across multiple systems and interfaces</p>
    <p><strong>Solution:</strong> Use ListFindNoCase() for case-insensitive directory lookup</p>
    <hr>
    
    <h2>Corporate Directory Structure</h2>
    <div style="background: ##f8f9fa; padding: 15px; border: 1px solid ##ddd; margin: 10px 0;">
        <p><strong>Departments:</strong> #companyDepartments#</p>
        <p><strong>Roles:</strong> #employeeRoles#</p>
        <p><em>Directory searches work with any capitalization format</em></p>
    </div>
    
    <h2>Directory Search Results</h2>
</cfoutput>

<cfloop array="#directorySearches#" index="search">
    <cfscript>
        // Use ListFindNoCase to find department or role
        if (search["type"] == "department") {
            searchPosition = ListFindNoCase(companyDepartments, search["query"]);
            searchList = companyDepartments;
        } else {
            searchPosition = ListFindNoCase(employeeRoles, search["query"]);
            searchList = employeeRoles;
        }
        
        isFound = searchPosition > 0;
        
        if (isFound) {
            matchedValue = ListGetAt(searchList, searchPosition);
            employeeCount = getEmployeeCount(search["type"], matchedValue);
        } else {
            matchedValue = "";
            employeeCount = 0;
        }
    </cfscript>

    <cfoutput>
        <div style="background: #isFound ? '##d4edda' : '##f8d7da'#; padding: 15px; margin: 10px 0; border-radius: 5px;">
            <h3>👤 Search Request from: #search["searcher"]#</h3>
            <p><strong>Search Type:</strong> #UCase(Left(search["type"], 1)) & LCase(Right(search["type"], Len(search["type"])-1))# | <strong>Purpose:</strong> #search["purpose"]#</p>
            <p><strong>Search Query:</strong> "#search["query"]#"</p>
            
            <cfif isFound>
                <div style="margin: 10px 0;">
                    <p>✅ <strong>#search["type"] == "department" ? "Department" : "Role"# Found!</strong></p>
                    <p>Matched #search["type"] == "department" ? "Department" : "Role"#: <strong>#matchedValue#</strong></p>
                    <p>Directory Position: #searchPosition#</p>
                    <p>👥 Employees Found: <strong>#NumberFormat(employeeCount)#</strong></p>
                    <p>🔗 <em>Click to view employee list with contact information and organizational details</em></p>
                </div>
                
                <cfif search["purpose"] == "Team Contact">
                    <p>📞 <em>Showing team leads and direct contact information</em></p>
                <cfelseif search["purpose"] == "Collaboration">
                    <p>🤝 <em>Displaying project managers and collaboration tools</em></p>
                <cfelseif search["purpose"] == "Org Chart">
                    <p>📊 <em>Generating organizational hierarchy and reporting structure</em></p>
                <cfelseif search["purpose"] == "Resource Planning">
                    <p>📋 <em>Showing skill sets and availability for project assignment</em></p>
                <cfelseif search["purpose"] == "Business Contact">
                    <p>💼 <em>Providing external contact information and business cards</em></p>
                </cfif>
            <cfelse>
                <p>❌ <strong>#search["type"] == "department" ? "Department" : "Role"# Not Found</strong></p>
                <p>Search term "#search["query"]#" did not match any #search["type"]#</p>
                <cfif search["type"] == "department">
                    <p>💡 <em>Available Departments: Engineering, Marketing, Sales, HR, Finance, Operations, Legal, Support</em></p>
                <cfelse>
                    <p>💡 <em>Available Roles: Manager, Director, Analyst, Developer, Designer, Coordinator, Specialist, Associate</em></p>
                </cfif>
            </cfif>
        </div>
    </cfoutput>
</cfloop>

<cfscript>
    // Calculate directory search statistics
    departmentSearches = 0;
    roleSearches = 0;
    successfulSearches = 0;
    totalEmployeesFound = 0;
    
    for (search in directorySearches) {
        if (search["type"] == "department") {
            departmentSearches++;
            position = ListFindNoCase(companyDepartments, search["query"]);
            if (position > 0) {
                successfulSearches++;
                matchedDept = ListGetAt(companyDepartments, position);
                totalEmployeesFound += getEmployeeCount("department", matchedDept);
            }
        } else {
            roleSearches++;
            position = ListFindNoCase(employeeRoles, search["query"]);
            if (position > 0) {
                successfulSearches++;
                matchedRole = ListGetAt(employeeRoles, position);
                totalEmployeesFound += getEmployeeCount("role", matchedRole);
            }
        }
    }
    
    totalSearches = ArrayLen(directorySearches);
    searchSuccessRate = totalSearches > 0 ? Round((successfulSearches / totalSearches) * 100) : 0;
</cfscript>

<cfoutput>
    <h2>📊 Directory Search Analytics</h2>
    <div style="display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 15px; margin: 20px 0;">
        <div style="background: ##e8f5e8; padding: 15px; text-align: center; border-radius: 5px;">
            <h3>Dept Searches</h3>
            <h2 style="color: blue;">#departmentSearches#</h2>
        </div>
        <div style="background: ##fff8dc; padding: 15px; text-align: center; border-radius: 5px;">
            <h3>Role Searches</h3>
            <h2 style="color: orange;">#roleSearches#</h2>
        </div>
        <div style="background: ##d4edda; padding: 15px; text-align: center; border-radius: 5px;">
            <h3>Success Rate</h3>
            <h2 style="color: green;">#searchSuccessRate#%</h2>
        </div>
        <div style="background: ##e3f2fd; padding: 15px; text-align: center; border-radius: 5px;">
            <h3>Employees Found</h3>
            <h2 style="color: purple;">#NumberFormat(totalEmployeesFound)#</h2>
        </div>
    </div>
    
    <h2>🎯 Case Flexibility Examples</h2>
    <div style="background: ##f8f9fa; padding: 15px; border: 1px solid ##ddd; margin: 10px 0;">
        <p><strong>How ListFindNoCase() Handles Corporate Directory Searches:</strong></p>
        <ul>
            <li><strong>"engineering"</strong> (lowercase) → Finds "Engineering" department (145 employees)</li>
            <li><strong>"MARKETING"</strong> (uppercase) → Finds "Marketing" department (32 employees)</li>
            <li><strong>"manager"</strong> (lowercase) → Finds "Manager" role (45 employees)</li>
            <li><strong>"DEVELOPER"</strong> (caps lock) → Finds "Developer" role (89 employees)</li>
            <li><strong>"Sales"</strong> (proper case) → Finds "Sales" department (67 employees)</li>
        </ul>
    </div>
</cfoutput>

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