1

I have this struct after I dump it like this:

<cfdump var="#currentInfo.answers#">

How can I access the value inside the LIST?

I need to compare that value with another variable in the future to allow me to do certain operations.

Struct

Geo
  • 3,160
  • 6
  • 41
  • 82

2 Answers2

5

The code below ought to do it:

currentInfo.answers["F0FF5FDC-D2C3-4D0F-D7D2D2886D5B430d"].LIST
barnyr
  • 5,678
  • 21
  • 28
  • is that reference always the same? Or does it change based on what questions you're pulling? – Matt Busche Oct 05 '12 at 16:40
  • it changes everytime, this is what I am trying to figure out now. – Geo Oct 05 '12 at 16:56
  • +1 it might be worth mentioning that you can use this bracket notation for the entire variable (as it is a struct). e.g `currentInfo["answers"]["F0FFF....etc"]["list"]` - Both produce the same results. – AlexP Oct 06 '12 at 13:54
0

Since the value is dynamic you'll need something like this:

currentKey="F0FF5FDC-D2C3-4D0F-D7D2D2886D5B430d";
currentInfo.answers[currentKey].LIST;
ale
  • 6,369
  • 7
  • 55
  • 65