Link to home
Start Free TrialLog in
Avatar of brihol44
brihol44

asked on

Looping through structure to find value...

Hello, Please take a look at my screenshot of a structure. Basically, I have single structure with  nested structures. I'm just trying to pull the "discount_id" where "DISCOUNT_CUSTOMER_SPENDING" eq "true". I can't seem to figure this one out. There should only be one available discount that eq "true" so I would think it would fairly simple.

Thanks for the help!

BrianUser generated image
SOLUTION
Avatar of gdemaria
gdemaria
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of brihol44
brihol44

ASKER

ok, I think I did try something similar but I get my screenshot structure from...

<cfset discount = getCartDiscountData(cart=mycart)>

Then comes the structure...

When I add in your code I get the following error.

Variable DISCOUNTRESPONSE is undefined.
If you named the structure "discount"

<cfset discount = getCartDiscountData(cart=mycart)>


Then you should not use the variable name DiscountResponse, instead use the variable "discount" instead
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
My solution works for what I was needing regarding the structure I have.