my data is coming as: ```<cfset session.data.i...
# cfml-beginners
s
my data is coming as:
Copy code
<cfset session.data.id = '212|a,b|people,looking'>

<cfloop collection="#session.data#" item="i">
<span>#getToken(session.data[i],2,'|')#</span>
<span> #getToken(session.data[i],3,'|')#</span></div>
</cfloop>
i want to display a = people b= looking, i am missing something here
t
You are outputting the 2nd token and the 3rd token from the string data (with "|" as separator), hence you are getting:
a,b  people,looking
assuming your data pattern is:
#id#|#list_of_vars#|#list_of_words#
such as:
212|a,b,c,d,...|people,looking,at,you,...
you can just loop through the 2nd token and outputting each item in the 2nd token & 3rd token (also assume they are the same length):
Copy code
<cfset session.data.id = '212|a,b,c,d|people,looking,at,you'>
<cfset firstDataSet = listGetAt(session.data.id, 2, "|")>
<cfset secondDataSet = listGetAt(session.data.id, 3, "|")>
<cfloop from="1" to="#listLen(firstDataSet)#" index="n">
    #listGetAt(firstDataSet,n)# = #listGetAt(secondDataSet,n)#
    <br>
</cfloop>
see: https://trycf.com/gist/8dbb4e8759accc7db5dcae11e114c33c/lucee5?theme=monokai
👍 2