Hey All,
It seems like a common way to cast a value to the type "List of Dictionary" is via:
cast(194, local!thingBeingCast)
Does anyone know of a way to do this without hardcoding the "194" value? This approach doesn't seem very explicit (I personally have to remind myself of what it's doing in a blank rule whenever I see it), and god-forbid that type id changes one day and needs to be changed one-by-one throughout the codebase.
Thanks!
Discussion posts and replies are publicly visible
The other responses are great, but I'll also add in a shameless plug to use a map instead of a dictionary if at all possible. A map provides much the same functionality as a dictionary by allowing you to use custom key value pairs, but it also has additional benefits including:
You can always cast to a map like this:
cast( a!listType(type!Map), { {id: 1, desc: "blah blah", }, {id: 2 , desc: "blah blah blah", } } )