Relevance Query: How to get computer and group name from computer groups?

Hi ,

I have written below relevance query. It returns only computer details but we have more than one computer.

(
item 0 of it as string & “@$@” &
item 1 of it as string & “@$@” &
item 2 of it as string
) of
(
names of members of it,
id of members of it as string | “”,
name of it as string | “”
)
of bes computer groups

Please help me on above query.

@Hareramrai, what is the error you are getting?
What are you getting and what are you hoping to retrieve?
Sorry your post is not clear to me as to your ask.

I want to get the list of all the computer with computer name, computer id and group name. I am not getting any error but result is not correct.

Helps with data or picture, otherwise hard for us to imagine what you are getting and what you want to get.

Based on your comment, this is how I would write the Relevance statement:

(name of it, id of it, concatenation ", " of names of bes computer groups) of bes computers
1 Like

Currently I am using the below query which returns computer id and group name.

(
ids of members of it,
name of it as string | “”
) of bes computer groups

The above query returns below result. I want to have computer name as well in the result.

{“BESAPI”=>{“xmlns:xsi”=>“http://www.w3.org/2001/XMLSchema-instance”, “xsi:noNamespaceSchemaLocation”=>“BESAPI.xsd”, “Query”=>{“Result”=>{“Tuple”=>[{“Answer”=>[1166597, “TEST_GRP_ALL”]}, {“Answer”=>[11042661, “TEST_GRP_ALL”]}, {“Answer”=>[11042661, “TEST_GRP_LINUX”]}, {“Answer”=>[1166597, “TEST_GRP_WINDOWS”]}]}, “Evaluation”=>{“Time”=>“8.987ms”, “Plurality”=>“Plural”}}}}

You can try my statement above.
The concatenation clause is used to ensure only one row is returned even if a computer might belong to more than one computer groups.

It’s returning the all the groups even though computer does not belongs to that group.

Sorry I missed a “of it” clause:

(
	name of it,
	id of it,
	concatenation ", " of names of bes computer groups of it
) of bes computers

or,

(
	name of it & "@$@" &
	id of it as string & "@$@" &
	concatenation ", " of names of bes computer groups of it
) of bes computers

Thank you @leewei last one has solved my problem.