Pulling info from an analysis property populated by a tuple

So, instead of bringing in a couple of different properties from an analysis to create a report, I was trying to put a tuple in one property (Drive/free space/total space/percent free):

	(
	(
		/* Drive letter/Mount Point of "drive" */
		name of it , 
		(
			/* free space of "drive" */
			free space of it / 
			(
				1024 * 1024 
			)
		)
		as string & " MB" , 
		(
			/* total size of "drive" */
			total space of it / 
			(
				1024 * 1024 
			)
		)
		as string & " MB" , 
		(
			(
				/* integer percentage free of "drive" */
				free space of it * 100 / total space of it 
			)
			as integer 
		)
	)
	of drives 
	whose
	(
		(
			type of it = "DRIVE_FIXED" 
		)
	AND
		(
			total space of it > 0 
		)
	)
)

First, can you refer to the parts of the tuple with item # of to get the individual parts of the tuple, and…

If that works, how would you you refer to parts of the tuple using this to show the information for drives with less than 20% of free disk space? (Using something like this):

(
name of item 0 of it|“Computer Name missing”
, (if (size of item 1 of it = 1) then ((if it = “” then “No values” else it) of concatenation “;” of values of results (item 0 of it, elements of item 1 of it)) else (if (size of item 1 of it > 1) then (("Duplicates: " & concatenation “|” of ((name of it) & “=” & (id of it as string)) of elements of item 1 of it) as string) else (“Property does not exist”)))
, (if (size of item 2 of it = 1) then ((if it = “” then “No values” else it) of concatenation “;” of values of results (item 0 of it, elements of item 2 of it)) else (if (size of item 2 of it > 1) then (("Duplicates: " & concatenation “|” of ((name of it) & “=” & (id of it as string)) of elements of item 2 of it) as string) else (“Property does not exist”)))
)
of
(
elements of item 0 of it
,item 1 of it
,item 2 of it

)
of
(
set of BES computers whose (name of it as uppercase is “MYCOMPUTER”)
, set of bes properties whose (name of it as lowercase = (“Property1”) as lowercase)
, set of bes properties whose (name of it as lowercase = (“Property2”) as lowercase)

)

Thanks,
Bob_K

I won’t be able to try anything on this for some time, but I can outline for you the approach I would take.

Start by pulling one property result for one computer to see what your options are. While the client relevance you cite creates a tuple, I’m not sure whether it remains a tuple as a ‘bes property result value’, or whether it’s just a string containing commas at that point.

So get the value retrieved, and then check whether you can retrieve ‘items 0 of values of …’

If ‘items 0’ fails, see whether you can use the ‘tuple string item’ inspector, by retrieving ‘tuple string items 0 of values of results…’

Then, you can filter appropriately. It likely would be either

values whose (item 2 of it < 20) of results of ...

or

values whose (tuple string item 2 of it as integer < 20) of results...

@JasonWalker,

Maybe not quite the code you were looking for, but hopefully the results will show you what you were looking for: (I wasn’t able to get item 1 or tuple string item 1 to work)

	(
	item 0 of it , substrings separated by ";" 
	whose
	(
		(
			following text of last " " of it as integer 
		)
		< 20 
	)
	of item 1 of it 
)
of 
(
	name of item 0 of it | "Computer Name missing" , 
	(
		if
			(
				size of item 1 of it = 1 
			)
		then
			(
				(
					if
						it = "" 
					then
						"No values" 
					else
						it 
				)
				of concatenation ";" of values of results 
				(
					item 0 of it , elements of item 1 of it 
				)
			)
		else
			(
				if
					(
						size of item 1 of it > 1 
					)
				then
					(
						(
							"Duplicates: " & concatenation "|" of 
							(
								(
									name of it 
								)
								& "=" & 
								(
									id of it as string 
								)
							)
							of elements of item 1 of it 
						)
						as string 
					)
				else
					(
						"Property does not exist" 
					)
			)
		)
	)
	of 
	(
		elements of item 0 of it , item 1 of it 
	)
	of 
	(
		set of BES computers , set of bes properties 
		whose
		(
			name of it = 
			(
				"Drive Space Tuple" 
			)
		)
	)

Returns:
system1, ( D:, 8963 MB, 51196 MB, 17 )
system2, ( C:, 39573 MB, 241126 MB, 16 )
system3, ( /var/log, 0 MB, 10230 MB, 0 )
system4, ( D:, 2570 MB, 20476 MB, 12 )
system5, ( /var/log, 0 MB, 10230 MB, 0 )

Thanks,
Bob_K