I have a map and a dictionary.. How can I merge them and save the output to a datasubset?
Discussion posts and replies are publicly visible
a!localVariables( local!dict: ({x: 1, y: 2}), local!map: a!map(item: 1, value: "PRueba"), todatasubset(union(cast(type!Map, local!dict), local!map)) )
if the dictionary is list?
Im getting below error with above example
CastInvalidCould not cast from List of Dictionary to Map. Details: CastInvalid
Are you using my code? Which version are you using? If not, please share it...
IN case is a list of dict...
a!localVariables( local!dict: {({x: 1, y: 2}), ({x: 3, y: 4})}, local!map: a!map(item: 1, value: "PRueba"), todatasubset(union(cast( a!listType(type!Map), local!dict), local!map)) )
it worked.. Thank You
In general I would recommend always casting a dictionary to a map (or even constructing a map from the beginning) rather than using a dictionary. Since maps are strongly typed, they're generally easier to index data and work with in your applications