Not sure what I'm missing here...
I have two vales as follows: AL,AR
And I am trying to add these two values to a list so I can loop the list and perform the next action. I am using this <cfset newState2 = ValueList(newState)> but keep receiving the following error:
Message: string invalid variable declaration [AL,AR]
d
David Cook
01/08/2025, 5:41 PM
Are the values columns in a query? Because that's what valueList is used for.
m
mauzer
01/08/2025, 5:43 PM
Ah yes of course! No they are not. I have one list which is and valuelist is working for that which is good. But how can I add these items to a list ?
@mauro - it looks like the value is an array with as list element. Try to append to the list : <cfset newState2 = newState[0] /> and then list append it
m
mauzer
01/08/2025, 5:44 PM
Cheers guys much appreciated. 🙏 Will give those a shot. Thank you😀
👍 1
r
Reuben Brown
01/08/2025, 5:50 PM
you may also need to test if the value is an array first - not sure where it is coming from so if there is the possibility that if there is just 1 value, it could be a string and not an array - you need to test for it first.
👍 1
Reuben Brown
01/14/2025, 5:40 PM
@mauzer any update on if the issue has been fixed and what fixed it?