Search code examples
jsonpathaws-step-functions

How to convert string to list in JSONPath notation?


stepfunctionscreenshot

The JSON in line 5 in the Parameters section of the screenshot uses JSONPath notation in AWS Step Functions. The key is "Values.$" and the value is a JSONPath that selects a string "$". However, I need to pass in a LIST not a STRING. The value that $ selects is a string.

If I put brackets around, it no longer recognizes that I'm using JSONPath notation and simply passes in the dollar sign character instead of gets the value from inputs.

How can I use JSONPath notation and pass in a string as a list?


Solution

  • Should be able to use the States.Array Intrinsic Function since Parameters is a Payload Template

    {
      "Filters": [{
        "Name": "replication-task-arn",
        "Values.$": "States.Array($)"
      }],
      "MaxRecords": 20,
      "WithoutSettings": true
    }