2

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

3
  • Is your tenders array always 1 or more than 1 or some is empty ? Commented May 9, 2019 at 14:26
  • Should always be 1. We only have 1 charge at a time. Commented May 9, 2019 at 14:29
  • Could you please post your Json data here ? If possible ? Commented May 9, 2019 at 14:36

1 Answer 1

4

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;
Sign up to request clarification or add additional context in comments.

1 Comment

James, I swear I tried this and it didn't work. I must have done something slightly different but this WORKS! Thx.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.