Rest api error - & `"$x$`" &

“item 0 of it as string & "$x$" & item 1 of it as string”
"/api/query?relevance=(item 0 of it as string & "$x$" & item 1 of it as string, item 2")"

when im doing this in the rest api what i get is this -

“Cannot index into a null array.”

how can i fix it?

Reading that, I have no idea what you’re attempting…what is the full query?

1 Like

im trying to get multiple results but dont want to use “,” to seperate
(item 0 of it as string & “$x$” & item 1 of it as string) of ((if (exists result (item 0 of it , item 1 of it) and exists values of result (item 0 of it , item 1 of it)) then (concatenation “%0A” of values of result (item 0 of it , item 1 of it)) else ("")) , (if (exists result (item 0 of it , item 2 of it) and exists values of result (item 0 of it , item 2 of it)) then (concatenation “%0A” of values of result (item 0 of it , item 2 of it)) else (""))) of (elements of intersection of ((sets of items 0 of (computers of it , values whose (it as lowercase = “iftach”) of it) of results of bes property “Computer Name”)) , bes property “Computer Name” , bes property “OS”)

I can check the query on my test system later, but looking again at the first post I wonder…are you URL-encoding the query? How are you sending this via REST? Depending on your tool, you may need to url-encode before you send, changing quotes to %22, spaces to %20, etc.

another example

if i do this i get results-
(name of it, id of it) of bes computers whose (name of it as lowercase = "hwt")

if i do this one, getting error-
(name of it & “|” & id of it) of bes computers whose (name of it as lowercase = "hwt")
you can try this.

You can’t do string concatenation on properties that aren’t strings

i see,
so the only why to me is to do a comma?

Not at all, you cast the property that is not a string, to string

can you give an example?