I'm working with AWS Step Functions to save records to DynamoDB. I am trying to control the name of the DynamoDB record based on the input
Based on an input of number1, the record should be 'lesser' or 'greater' for example.
const saveInDynamoDbState = new DynamoPutItem(this, 'saveInDynamoDbState', {
table: props.table,
item: {
id: DynamoAttributeValue.fromString(
JsonPath.stringAt(
"States.Format('{}', (JsonPath.numberAt('$.number1') > 0 ? 'greater' : 'lesser'))",
),
),
....
}
});
but it seems like the logic is being ignored. I asked Amazon Q and it recommended States.MathMin/States.MathMax which I don't even think exists based on these docs (https://docs.aws.amazon.com/step-functions/latest/dg/intrinsic-functions.html#asl-intrsc-func-math-operation )