List contain string and numbers

Good day All.

This maybe a beginners problem, but i can’t seem to find the awnser.

Problem is I have a list with a mix of items with number and strings, I’m trying to get the strings of the list with a loop. this returns me with a empty list.

Thank u for the help

Why not just use an Object.Type node and a group by key node, or filter by a book mask after checking for similarities?

@jacob.small

I did all above and got the data i wantend, but I was trying to make it work within a code blok insted of using different nodes, just wondering if it works like that

Thank u anyway for your responce :smile:

Ah. Well, you’re getting into imperative code when you don’t have to, which is giving you some odd results.

This might help:

4 Likes

@jacob.small, Thank u very much!! I appreciate your time and effort.

You have anwserd a lot of questions for me, still so many new question come up.
so last one for now…

I dont have a great background in programming, so to understand what is happening I tried to reverscode what you wrote.
Can you tell me why the string “groups” works in the code blok but not in the node?

Thank u very much

The ‘groups’ output of the GroupByKey node is the result of the Dictionary.ValueAtKey function.

As List.GroupByKey node has two outputs that contain separately named lists, it needs a way to know which output you want to work with, and design script uses a dictionary as an intermediate object to accomplish this. In node for the function is unnecessary. You can experiment with this by generating the design script code by highlighting both the List.GroupByKey node and the Object.Type node, right clicking in the workspace background and choose ‘node to code’. The ‘multi line’ version of what I posted should show up.

1 Like

@jacob.small, Thank u very much!!
Much appreciation for your time, effort and explanation :smile:

1 Like