David Jacobson
David Jacobson

Reputation: 179

Getting Usable data from deserialized JSON data using ColdFusion

I have successfully deserialized my JSON data into a structure, however, it appears to be a multilayered structure with an array inside of it. How do I get the data where the arrows are in the image into a usable variable?

I have already tried several ways to try and get the data but get various error messages. Our current solution isn't multi-layered like this so this type of variable works, but not with this new response.

The image is dumping this variable:

<cfset responseStruct = deserializeJSON(response.Filecontent)>

enter image description here

Upvotes: 2

Views: 101

Answers (1)

James A Mohler
James A Mohler

Reputation: 11120

Looks like you need to

responseStruct.transaction.tenders[1].amount_money.amount;
responseStruct.transaction.tenders[1].card_details.card.card_brand;
responseStruct.transaction.tenders[1].card_details.card.last_4;
responseStruct.transaction.tenders[1].card_details.status;
responseStruct.transaction.tenders[1].transaction_id;

Upvotes: 4

Related Questions