Skip to main content
May 29, 2007
Question

Dynamic Quoted Value List Column

  • May 29, 2007
  • 3 replies
  • 456 views
While working on an autosuggest custom tag, I am allowing the user to pass in either an array or a query. If a query, I need to loop through each column and add it to the possible suggestions. I cannot however get the dynamic column name to read without CF7.02 throwing an error. I have attached the snippet. The error received is: Invalid CFML construct found on line 98 at column 77.

ColdFusion was looking at the following text: [

Any help would be much appreciated.

This topic has been closed for replies.

3 replies

May 29, 2007
Thank you guys.

efecto747 that is what I was going for. I did realize that if there was more than one column it would break, but I didn't know how to dynamically call each column as I looped through. Now I do. Thanks!
Inspiring
May 29, 2007
> <cfset mySuggestions =
> quotedValueList(attributes.suggestion[queryColumn])>
> </cfif>

<cfset mySuggestions =
listQualify(arrayToList(attributes.suggestion[queryColumn]), "'")>

--
Adam
Participating Frequently
May 29, 2007
Hi, something like this should do the trick:

<cfset mySuggestions = Evaluate("QuotedValueList(attributes.suggestion." & queryColumn & ")")>

I'm not sure if you're aware, but you'll get an error if attributes.suggestion contains more than one column. You might need to change it to loop through the column list instead?

cheers