ColdFusion Array of Structures iterate to get a specific values

Dan Schimo
Dan Schimo used Ask the Experts™
on
Array-of-Struct.
Hello Experts,

I have an array with stuctures looking like the one in image.

I would like to get the Value of "V"  for each structure, and populate a List. please help..

--Dan
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

assuming array/structure is called myData...


<cfloop index="kk" from="1" to="#arrayLen(myData)#">
   <cfoutput>#myData[kk].v#</cfoutput>
</cfloop>

Oh sorry, you said you want to build a list

<cfset myList = "">

<cfloop index="kk" from="1" to="#arrayLen(myData)#">
   <cfset myList = listAppend(myList, myData[kk].v)>
</cfloop>


Most Valuable Expert 2015

Commented:
Just curious, is the list for display purposes or will be manipulating it?
Dan SchimoAnalyst

Author

Commented:
it will be sent to a webservice
Most Valuable Expert 2015

Commented:
Ok. If you're not manipulating the results, that's fine.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial