Relevance expression to list multiple computer IDs by name, given a list of names

(imported topic written by Pol.o.Currain)

Hi All,

Question for anyone reading about how I would go about listing multiple computer IDs per name, when supplied with a list of computer names?

Let me explain…

Let’s take it that the following computers exist in the system:

Name ID

foo 123
Foo 456
FOO 789

And I’ve been given a (pipe delimited) list of computers for which I want to get ID’s, e.g.

“|foo|bar|baz|”

What I would like to figure out is an expression that would return me the following result:

foo, 123|456|789

I’ve got this expression so far, but it’s still returning me one ‘row’ per computer:

(
item 0 of it, concatenation “|” of
(
item 1 of item 1 of it
whose
(
item 0 of item 1 of it = item 0 of it
)
)
)
of
(
(
unique values
whose
(
"|" & it & “|” is contained by “|foo|bar|baz|”
)
of
(
it as lowercase
)
of names of bes computers
)
,
(
name of it as lowercase, id of it as string
)
of bes computers
)

Can anyone help?

Also, I’m not sure how performant this would be given either a large list of computers to find, or a large number of computers existing on the system, so any way to improve on that would be great too.

Cheers,

Paul.