Find a number of sublist

#1

So here I have list of sublists which is basically import from excel file and list of sheet names. What I want to do is to find numbers of sublists in which each given sheet name is located i.e. to find in which string the given sheet name is located in excel file. How would I do that?

0 Likes

#2

Hi @mironov.boris

Is this what your looking to do?

0 Likes

#3

Well, not quite, here’s an example of what result I’d like to get

0 Likes

#4

If you know the index of the value in the sublist (in the example, it is index 2), it is easy with this:

If you don’t know the index or if it can change, you will need to use List.Contains but it will give you the opposite of what you want, i.e. instead of a list [2, 3, 4, 0] you will get a list of [3, -1, 0, 1, 2] which matches the list with sublist with the list of parameter values.

0 Likes

#5

Oh, it worked, thanks. Only in == node I had to enable the first layer for X. Now I want to extarct values at some exact number from sublists, like if I set number 1 for example above it’ll give a result like [f, s, t, a]. I thought it’d work like this

but it seems doesn’t take lists as indexes. Any ideas here?

0 Likes

#6

Can you show the input for X and what the error is? As for using lists as the index, using List.GetItemAtIndex usually works better as it also allows levels.

0 Likes

#7


And List.GetItemAtIndex doesn’t seem to work here or it just shows the same error

0 Likes

#8

Well, I figured it out

0 Likes