List.AllIndicesOf - aka VLookUp

With some help from the Forum I have managed to build a little “LookUp” script. The idea is to check for one parameter in an element, find it in an Excel table and return the matching one to be added to the element in a different parameter.

I had a test setup which worked well, but now with the full (Excel) list the "List.AllIndicesOf returns only empty lists. There are matching “numbers” in both lists (McL and QED - I checked) but my suspicion is that it might have something to do with “numbers”, “integers” and “strings” that I have overlooked.

Can someone point me in the right direction?

Thanks a lot.
P.

Use an Object.Type node to confirm you are checking matching data types, as 1 is not the same as “1”.

1 Like

Thanks @jacob.small that helped. Though I wonder whether there is a more elegant way to turn a double into a “string” without decimal zeros. My solutions feels a bit “winded”.

That’s the way via nodes at this point. You could use design script to reduce this to a single line though. Try ‘node to code’ on the whole lot of it.

1 Like

… I did not know it could do that. Best tip ever!
(Can’t believe I never realised that was there).

1 Like

Another one while we are at it then, select just the String.Split and then hit tab on your keyboard.

:wink:

1 Like