Not sure what I'm missing here... I have two vale...
# cfml-general
m
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
Are the values columns in a query? Because that's what valueList is used for.
m
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 ?
d
theNewList = listAppend(theOneThatIsAList,theOneThatIsntInaList)
r
@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
Cheers guys much appreciated. 🙏 Will give those a shot. Thank you😀
👍 1
r
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
@mauzer any update on if the issue has been fixed and what fixed it?