Singular expression error

(imported topic written by SystemAdmin)

I’m using the relevance below to return endpoint Video RAM information for an upcoming Windows 7 project. However I have many endpoints retuning an error stating "singular expression refers to a non-unique object. The analysis results, when hoeverd over, will show the proper returned property as well as the error. I am guessing this is due to the fact that the endpoint has multple video adapters.

I need to update the relevance so that the singular expression error is not returned, and I can get a clean output for a csv file or web reports.

(if (it < 128) then ("Insufficient Video Memory. Video Memory in MB: " & (it as string)) else (“Video RAM OK”)) of ((numeric value of (first match (regex “\d+$”) of it) of ((select “adapterram from Win32_VideoController” of wmi) as string)) / 1048576)

(imported comment written by NoahSalzman)

selects

will get past the non-unique object issue. However, I’m not sure how your regex will react to that. You might need

first matches

as well. Regardless of the plural/singular syntax issue… do you care which of the multiple adapters you are inspecting with the regex? Because if you do care, you will then need additional logic to deal with checking the size of multiple adapters.

(imported comment written by SystemAdmin)

My assumption is that if one adapter is supported for Win7, the other will as well, so just a single returned value is fine.

Where would I drop the

selects

language?

(imported comment written by SystemAdmin)

disregard, I got it

(imported comment written by NoahSalzman)

:slight_smile:

(imported comment written by SystemAdmin)

It is still returning the singular expression message. I have tried ‘contains’ with ‘first match’ and ‘first matches’ with the same results.

(imported comment written by SystemAdmin)

Hi,

You can try something like this:

(if (it < 1048576) then ("Insufficient Video Memory. Video Memory in MB: " & (it as string)) else ("Video RAM OK")) of ((numeric values of (first match (regex "\d+$") of it) of ((selects "adapterram from Win32_VideoController" of wmi) as string)))

I removed the division by 1048576 to convert to MB’s since that would require a singular value inside the value returned by the wmi select statement. This will get you over the singular expression error and will return multiple results in the analysis (if multiple values of RAM are present on the system).