Tag: SetVarListFromGridSelection

The SetVarListFromGridSelection creates lists of variables from grid values.

Tag Attributes


List name (cf 

) - mandatory

TargetGrid target name - mandatory according to context (like any other grid action)
(variable names)Anything except:

- "Name"
- "Action"
- reserved names:

Date: current date MM/DD/YYYY

Loop context:
LoopIndex: current loop index
ListSize: current list size
ListName: current list name

FolderDocuments: Windows account Documents folder path (%USERPROFILE%\Documents)
FolderTemp: Ytria temp folder path (%LOCALAPPDATA%/Ytria)

(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.
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)

Detailed Description

The values are taken from the displayed, formatted values (not the true, raw values) in the selected rows in the target grid. The row selection can be manual before launching the script or from the automation script itself.
The source of the values are identified by the grid column unique IDs. The fetched values then replace the variable names in all action parameters that use them.

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%})"/>