I have a usecase where there are two arrays : one is empty and second one has some values
Array1 : {"",""},
Array2 : {1:1,2:2}
After removing null or empty values from Array1 using filter function filter(a!isNotNullorEmpty,Array1), I have got empty array which is of List of Varient type
Now I want to apply difference function difference(Array1,Array2)
Since both are different data types, im being thrown error as invalid types.
If I have any values in Array1 like {1:1}, it would be of type List of Dictionary, but now here it is List of Varient since nothing there in the Array.
How can I perform difference function operation now? Is there any workaround to convert list of varient to list of dictionary ?
Discussion posts and replies are publicly visible
Something like this should do it.
cast(<YOUR_VALUE>, a!listType(type!Dictionary))
I tried this but it dint work.Array1 : List of Variant Assuming list of dictionariesArray2 is explicitly List of dictionariesI gave cast(array1,a!listType(recordtype))
I think that was small syntax error, try this one.
a!localVariables( local!array1: {}, local!array2: { i: 1, j: 2 }, cast(typeof({ local!array2 }), local!array1), )
Expression evaluation error at function a!listType [line 284]: Invalid type number. The type number must be an integer, type reference, or record type reference.Its throwing error for me
I accidentally reversed the parameters It should be
cast(a!listType(type!Dictionary), <YOUR_VALUE>)
I tried this too but same error is being thrown