Skip to main content
Participant
June 18, 2019
Question

Pulling Out Struct Variables

  • June 18, 2019
  • 1 reply
  • 218 views

Newbie question here… how do I get / set these values in this (sub)Struct to variables?

In the end, I want to have them set to variables like:

<cfset CategoryID = StructVar>
<cfset CategoryName = StructVar>

Thanks!

    This topic has been closed for replies.

    1 reply

    Participant
    June 19, 2019

    Actually ended up figuring this one out.

    I used:

    <cfset CategoryID =i.category.id>
    <cfset CategoryName =i.category.name>

    Since my CFLOOP over this array is:

    <cfloop array="#deserialized#" index=“i”>

    WolfShade
    Legend
    June 19, 2019

    I was going to say that it depends upon what you named the struct, but you did, indeed, figure it out.

    V/r,

    ^ _ ^