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

IsSimpleValue

Last update:
May 18, 2026

Description

Determines the type of a value.

Returns

True, if value is a string, number, Boolean, or date/time value; False, otherwise.

Category

Syntax

IsSimpleValue(value)

See also

Parameters

ParameterDescription
value
Variable or expression

Example

 
<cfscript> 
    string = "hello World"; 
    num = 1; 
    resultString = IsSimpleValue(string); 
    resultNum = IsSimpleValue(num); 
    resultDate = IsSimpleValue(Now()); 
    writeoutput("Is a string a simplevalue: " & resultString & "<br>"); 
    writeoutput("Is a number a simplevalue: " & resultNum & "<br>"); 
    writeoutput("Is a date/time a simplevalue: " & resultDate & "<br>"); 
</cfscript>
Output
Is a string a simplevalue: YES
Is a number a simplevalue: YES
Is a date/time a simplevalue: YES
Examples where values are not simple.
 
<cfscript> 
    // Define a struct 
    s={ 
        "a":1, 
        "b":2, 
        "c":3 
    } 
    // Define an array 
    a=[1,2,3,4,5] 
   // Struct is a complex value 
   writeOutput("Is struct a simple value: " & isSimpleValue(s) & "<br>") 
   // Array is also a complex value 
   writeOutput("Is array a simple value: " & isSimpleValue(a) & "<br>") 
</cfscript>
Output
Is struct a simple value: NO
Is array a simple value: NO

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