AWS Stepfunctions: Use a JSON value as part of JSONPath?

46 Views Asked by At

I have a JSON document which looks like this

[
  {
    "ChallengeData": {
        "Answer": "d00b2151c0ee4b4cc688e0377940981a"
    },
    "ChallengeHash": "e3acc830b1de2b06a4040654ba6a2e4a"
  },
  {
    "CurrentHashes": {
      "d00b2151c0ee4b4cc688e0377940981a": 0,
      "673b352ffb77d08ea9953cc24907b5b3": 1,
      "c8fd8f2484063948c1cc7ec48ea2db0f": 2,
      "9d73f4c8620cf0e17b4c98e3272e2bff": 3
    }
  }
]

This is the Input for my latest Pass state before the answer is going to be send to the client. The answer should be the numeric value from the CurrentHashes section. To look this up, previous states have calculated that the key here is the one being present in $.[0].ChallengeData.Answer. So I would like to use $.[0].ChallengeData.Answer to get the value from $.[1].CurrentHashes. How can this be achived?

0

There are 0 best solutions below