5

Is there a way in an aws step function to convert a string to a number?

I have a query param that is passed from api gateway to the step function. It is a string with a numeric value. I would like to cast the string to a number in the step function state language, but so far no luck.

1 Answer 1

9

There isn't a native solution for Step Functions to achieve this yet. Another workaround would be to use a simple lambda to convert the type.

Edit: A native workaround would be to use the intrinsic function States.StringToJson

e.g.

"NumberValue.$": "States.StringToJson("$.numberAsString")"
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.