Manipulate the selected input using the Parameters filter
While the InputPath
filter helps you limit the raw JSON input you provide, using the Parameters
filter, you can pass a collection of key-value pairs as input.
These key-value pairs can either be static values that you define in your state machine definition, or values that are selected from the raw input using InputPath
.
In your workflows, Parameters
are applied after InputPath
. Parameters
help you specify how the underlying task accepts its
input payload. For example, if the check-address
Lambda function accepts a string parameter as input instead of the JSON data, you can use the Parameters
filter
to transform the input.
In the following example, the Parameters
filter receives the input you selected using InputPath
in Step 3: Use the InputPath filter to select specific parts of an execution input and applies the intrinsic function States.Format
on the input items to create a string called addressString
. Intrinsic
functions help you perform basic data processing operations on a given input. For more information, see Intrinsic functions.
"Parameters": { "addressString.$": "States.Format('{}. {}, {} - {}', $.street, $.city, $.state, $.zip)" }
Consequently, the following string gets created and is provided to the check-address
Lambda function as input.
{ "addressString": "123 Main St. Columbus, OH - 43219" }