Troubles with List.GroupByKey in a definition


#1

Hey Everybody!

I’m having some trouble with the function “List.GroupByKey” in definitions, it only return nulls for each list.

When I’m trying the same thing in a code block it works fine.

Anyone who knows what I’m doing wrong?


#2

Hi @jgu,

Maybe you have to transform the value from the Element.ElementType into a string before you can use it as a key.

Kind regards,
Mark


#3

@jgu You don’t need a function, actually.
With nodes, you could do this …


The same can be converted to Design Script in a code block (without a function)

However, your function has a few issues.
The one below provides some output, not the desired one
But should help you identify the issues in yours.


#4

THANK YOU SO MUCH!!! - or in danish: TAAAAAAK!!!

That was exactly what I needed, everything is working as I wanted it