Relevance to get actions of a device

Can anyone offer any help with a relevance statement that I am trying to write that will get the actions on a computer by its id?

I have a relevance statement that works if only one computer is targeted in the action. If multiple computers are targeted then an empty response is returned, no errors.

The relevance that I am using is:

(id of it, name of it | “”, state of it as string | “”, time issued of it as string | “”, start date of it as string | “” as string, start time_of_day of it as string | “” as string, status of it of results of it as string | “Not Reported”, detailed status of it of results of it as string | “”, utc time flag of it) of top level bes actions whose (id of targeted computers of it = 12345678 )

if I try to change this to:
(id of it, name of it | “”, state of it as string | “”, time issued of it as string | “”, start date of it as string | “” as string, start time_of_day of it as string | “” as string, status of it of results of it as string | “Not Reported”, detailed status of it of results of it as string | “”, utc time flag of it) of top level bes actions whose ((concatenation “,” of (ids of targeted computers of it as string)) contains “12345678”)

I get the error

Error: Singular expression refers to non-unique object.

This happens because status of it of results of it as string | “Not Reported”, detailed status of it of results of it as string | “” are returned for each computer that the action was targeted on.

Any suggestions on how I can also filter results of it for a specific computer by id so that a single value is returned?

Any help would be appreciated.

I can write an example for you once I know how you want your output.

An Action (BES Action) is a singular item.
Once you target an Action against many computers, we get BES Action Results.
The computers will return different statuses.

So there is a master/detail relationship.

This statement will work, but not our final product.

(
    id of it, 
    name of it | "", 
    state of it as string | "", 
    time issued of it as string | "", 
    start date of it as string | "" as string, 
    start time_of_day of it as string | "" as string, 
    concatenation of "; " of statuses of it of results of it as string | "Not Reported", 
    concatenation of "; " of detailed statuses of it of results of it as string | "", 
    utc time flag of it
) of top level bes actions 
whose ((concatenation "," of (ids of targeted computers of it as string)) contains "12345678")

Thanks for the response. I am looking for a tuple to be returned. I am calling the query method of the rest API with this relevance.

The concatenations of it all seem to return empty strings when I ran that query. I am trying to show the time issued, start time, state, and status, and name of all actions in a custom web interface for a single device by ID and filter on that device only. (screenshot below of what I am trying to accomplish is from an action that was targeted to a single device and using the original relevance)

Sorry it should be

concatenation ";"

NOT

concatenation of ";"

Thanks that works and we are almost there. What would be the best way to tie the status and detailed status back to an individual computer to know which status was associated with my particular computer?

I am trying to run this against a computer with ID 14478600

the following is returned:
1929, Patching - 7/27/2016 2:14:01 PM GMT, Stopped, ( Wed, 27 Jul 2016 10:14:54 -0400 ), , , Not Relevant; Pending Downloads, The Fixlet which this action addresses is not relevant on this machine.; Waiting for downloads to be mirrored., False
2004, Patching - 7/27/2016 2:16:32 PM GMT, Stopped, ( Wed, 27 Jul 2016 10:17:12 -0400 ), , , Not Relevant; Pending Downloads, The Fixlet which this action addresses is not relevant on this machine.; Waiting for downloads to be mirrored., False
2079, Patching - 7/27/2016 2:50:29 PM GMT, Open, ( Wed, 27 Jul 2016 10:51:00 -0400 ), , , Not Relevant; Fixed, The Fixlet which this action addresses is not relevant on this machine.; The action executed successfully., False
2148, 3133977: BitLocker can’t encrypt drives and the service crashes in svchost.exe process in Windows 7 or Windows Server 2008 R2 - Windows Server 2008 R2 SP1 - KB3133977 (x64), Open, ( Wed, 27 Jul 2016 14:47:19 -0400 ), , , Fixed, The action executed successfully., False
2149, Multiple Action Group, Stopped, ( Wed, 27 Jul 2016 16:27:37 -0400 ), ( Sat, 06 Aug 2016 ), 16:26:51, , , False

This action was run on two computers so two statuses are returned.

The two statuses that are returned are: Not Relevant; Fixed How can I filter this so that I only get the status for the single device computer with ID 14478600

Right now there is no way to tell which status belongs to which device.