# ChoiceJsonPathProps

Properties for defining a Choice state that using JSONPath.

Extends: [StateBaseProps](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_stepfunctions.StateBaseProps.html), [AssignableStateOptions](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_stepfunctions.AssignableStateOptions.html), [JsonPathCommonOptions](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_stepfunctions.JsonPathCommonOptions.html)
Used as argument in: [Choice.jsonPath](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_stepfunctions.Choice.html#jsonpath)

- Source: [`aws-stepfunctions/lib/states/choice.ts`](https://github.com/aws/aws-cdk/blob/v2.278.0/packages/aws-cdk-lib/aws-stepfunctions/lib/states/choice.ts#L15)
- Type last changed: v2.178.0 · 6 Feb 2025

## Example

TypeScript:

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_stepfunctions as stepfunctions } from 'aws-cdk-lib';

declare const assign: any;
const choiceJsonPathProps: stepfunctions.ChoiceJsonPathProps = {
  assign: {
    assignKey: assign,
  },
  comment: 'comment',
  inputPath: 'inputPath',
  outputPath: 'outputPath',
  queryLanguage: stepfunctions.QueryLanguage.JSON_PATH,
  stateName: 'stateName',
};
```

Python:

```python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_stepfunctions as stepfunctions

# assign: Any

choice_json_path_props = stepfunctions.ChoiceJsonPathProps(
    assign={
        "assign_key": assign
    },
    comment="comment",
    input_path="inputPath",
    output_path="outputPath",
    query_language=stepfunctions.QueryLanguage.JSON_PATH,
    state_name="stateName"
)
```

Java:

```java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.stepfunctions.*;

Object assign;

ChoiceJsonPathProps choiceJsonPathProps = ChoiceJsonPathProps.builder()
        .assign(Map.of(
                "assignKey", assign))
        .comment("comment")
        .inputPath("inputPath")
        .outputPath("outputPath")
        .queryLanguage(QueryLanguage.JSON_PATH)
        .stateName("stateName")
        .build();
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.StepFunctions;

var assign;

var choiceJsonPathProps = new ChoiceJsonPathProps {
    Assign = new Dictionary<string, object> {
        { "assignKey", assign }
    },
    Comment = "comment",
    InputPath = "inputPath",
    OutputPath = "outputPath",
    QueryLanguage = QueryLanguage.JSON_PATH,
    StateName = "stateName"
};
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

var assign interface{}

choiceJsonPathProps := &ChoiceJsonPathProps{
	Assign: map[string]interface{}{
		"assignKey": assign,
	},
	Comment: jsii.String("comment"),
	InputPath: jsii.String("inputPath"),
	OutputPath: jsii.String("outputPath"),
	QueryLanguage: awscdk.Aws_stepfunctions.QueryLanguage_JSON_PATH,
	StateName: jsii.String("stateName"),
}
```

## Properties

- `assign`: { [key: string]: any } — Workflow variables to store in this step.

  **Default:** Not assign variables

  Using workflow variables, you can store data in a step and retrieve that data in future steps.

- `comment`: string — A comment describing this state.

  **Default:** No comment

- `inputPath`: string = $ — JSONPath expression to select part of the state to be the input to this state.

  May also be the special value JsonPath.DISCARD, which will cause the effective
  input to be the empty object {}.

- `outputPath`: string = $ — JSONPath expression to select part of the state to be the output to this state.

  May also be the special value JsonPath.DISCARD, which will cause the effective
  output to be the empty object {}.

- `queryLanguage`: [QueryLanguage](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_stepfunctions.QueryLanguage.html) = JSONPath — The name of the query language used by the state.

  If the state does not contain a `queryLanguage` field,
  then it will use the query language specified in the top-level `queryLanguage` field.

- `stateName`: string — Optional name for this state.

  **Default:** The construct ID will be used as state name
