Skip to main content
Participant
October 6, 2023
Answered

Using valuearray in cfset seems like it should be obvious and easy...

  • October 6, 2023
  • 1 reply
  • 332 views

I'm trying to do the following:

 

The query works and cfdumps 2 items as expected. valuearray fails as part of cfset set and I've tried various and sundry combinations of quotes and such with no luck. Can someone help me sort this out? The end goal is to have an array I can do an arrayFind against to see if someone gets to see a particular web app or not.

 

Tanks,

 

JimB

 

    This topic has been closed for replies.
    Correct answer Dave Watts

    The syntax for CFSET is

     

    <cfset var = expression>

     

    where the expression is any valid CF expression. If it's a literal value, it would be wrapped in double quotes, like this:

     

    <cfset first_name = "Bob">

     

    Dave Watts, Eidolon LLC 

    1 reply

    Dave WattsCommunity ExpertCorrect answer
    Community Expert
    October 7, 2023

    The syntax for CFSET is

     

    <cfset var = expression>

     

    where the expression is any valid CF expression. If it's a literal value, it would be wrapped in double quotes, like this:

     

    <cfset first_name = "Bob">

     

    Dave Watts, Eidolon LLC 

    Dave Watts, Eidolon LLC
    IamJimbusAuthor
    Participant
    October 9, 2023

    Thanks Dave!

    I must have been severely under-caffeinated to try and make up <cfset>var=val</cfset>

    Now, I just have to figure out the cf 11 equivalent of ValueArray 😞

     

    Thanks for the help,

    JimB

    Community Expert
    October 9, 2023

    In CF 11, I think you have to iterate through the query to build an array. Search for "query array ColdFusion" and you should find some simple custom functions for that.

     

    Dave Watts, Eidolon LLC 

    Dave Watts, Eidolon LLC