Tag: SetVarListFromGridSelection

The SetVarListFromGridSelection creates lists of variables from the values in the selected rows.

<SetVarListFromGridSelection/>
XML

Tag Attributes

ListName

List name - Required

TargetGrid target name - Required according to context (like any other grid action)
(variable names)Any unreserved name valid in XML. Reserved names are listed on: Variables
(Variable Values)Valid grid column IDs.
If a column is not found (invalid column ID), an error is raised, the action fails, the list ends up empty and the loop will do nothing.
Where/WhereAlternate

Unique ID of column that's used as a filter. The field value in this column is tested against the the value set in (where mode).
See the example below with OBJECTTYPE column used as a WHERE clause.

NOTE: WhereAlternate will use the underlying 'alternate value' (always integer) that exist in some columns as sapio365's 'OBJECTTYPE' or 'STATUS' columns.
<Select Lines="ByValue">
<SetVarListFromGridSelection v_ID='id' ListName='list_COUNT' where='OBJECTTYPE' Equals='Message'/>

(Where Mode)Text:
Equals
Begins
NotBegins
NotEquals
Contains
NotContains
Ends
NotEnds
IsIn (semicolon separated list)
IsNotIn (semicolon separated list)

Number:
GreaterThan
GreaterOrEquals
LessThan
LessOrEquals

Date/Time:
not suported

Examples:
-Begins="abcd"
-IsIn ="abcd;efgh"
UniqueTrue: Only keep unique variable sets
"Any variable name": Only keep sets with unique value for this variable
OrderAscByVariable Name on which to order ascendingly (cannot be combined with OrderDescBy)
OrderDescByVariable Name on which to order descendingly (cannot be combined with OrderAscBy)
UseAlternateValueSemicolon Separated ColumnID list: For columns in this list, the value in the output list will be the underlying 'alternate value' (always integer) that exist in some columns as sapio365's 'OBJECTTYPE' or 'STATUS' columns.
RawFormatTrue: Use raw (unformatted) value (otherwise display formatted value is used)

Detailed Description

The variable can be referenced to in the script after its declaration with SetVar. To reference a variable, enclose it in: {% and: %}. Variable names are not case sensitive.

Example Script

<ytriaAutomation Application="sapio365">
	<!-- to be launched from a groups view with a selection of rows -->
	<!-- Generate a List of SetVar from the current selection in the grid:
	- Set list name and target grid (target is not needed in sapio365 or main grids in Notes products)
	- Add variable names connected to grid column unique IDs (GCVD penultimate column) to store grid values into
	In this example "displayName", "groupType", "createdDateTime", "mailEnabled" are column unique IDs from the sapio365 Groups grid:-->

	<SetVarListFromGridSelection ListName="GroupList" GroupName="displayName" Type="groupType" Kreator="createdDateTime" Mail="mailEnabled" OrderAscBy="GroupName"/>
	<!-- loop on the generated list -->
	<loop list="GroupList">
		<ExecuteListAction/> <!-- Does a <SetVar/> with the attributes in SetVarListFromGridSelection except 'ListName' and 'Target' -->
		<echo value="Group {%GroupName%} is of type {%Type%} and was created on {%Kreator%} (mail enabled: {%Mail%})"/>
	</loop>
</ytriaAutomation>
XML

automation-tree-SetVarListFromGridSelection-1