How to Concatenate Strings in JSONata for State Machines?
Asked by
+count the rests
I'm really excited about the new JSONata support in State Machines, especially the use of variables—it's a total game changer! However, I'm struggling to figure out how to concatenate strings or include a variable within a string. I've tried searching online, but I can't find any useful information. Does anyone have any tips or insights on how to do this?
Answers
You can use the `&` operator to concatenate strings in JSONata. For example, you can format your string like this: `{ '% hi I am ' & $name & $last_name % }`. This should help you include your variables properly!
Reply to this answer
Add your answer
Answers are reviewed before publication.
5.1 sound test: Thank you so much! I've been going crazy trying to figure this out, even exploring functions like `join()` and `append()`. This really helps!
pencil marks: By the way, do you know any good AIs for working with JSONata and Step Functions? I've got a bunch of JSONPath state machines, and it's proving tough to migrate them.