WorkMaze / JUST.net

JUST - JSON Under Simple Transformation (XSLT equivalent for JSON).
MIT License
171 stars 54 forks source link

Switch case scenario #299

Open rajkra opened 4 months ago

rajkra commented 4 months ago

I have input json like Array{[ …. …. “Code”:”CA”], [ …. …. “Code”:”TX” ] }

While transforming how to have a switch case kind that converts these code CA to California and TX to Texas. Lets say we have these names fixed how to achieve this using JUST

Courela commented 2 months ago

There's no such thing as a switch/case method. You can achieve this with multiple 'ifcondition's, but that can become cumbersome with only a few options. Probably the best option is to create a custom function that does what is intended.