Variable: List of Script Variables from Grid Data
Tag: SetVarListFromGridSelection
The SetVarListFromGridSelection function creates lists of variables from grid values.
<SetVarListFromGridSelection/>
Tag Attributes
Attributes | Attribute Values | Value Description | Comment |
---|---|---|---|
ListName | N/A | Adds actions to a list that can be iterated in a LOOP action | Mandatory |
Target | N/A | Grid target name | Mandatory according to context (like any other grid action) |
Variable Names | N/A | Anything except: ErrorAction ErrorSysytem | N/A |
Variable Values | N/A | 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. | N/A |
Unique | True | Only keep unique variable sets. "Any variable name": Only keep sets with unique value for this variable. | N/A |
OrderArcsBy | N/A | Variable Name on which to order ascendingly (cannot be combined with OrderDescBy) | N/A |
OrderDescBy | N/A | Variable Name on which to order descendingly (cannot be combined with OrderAscBy) | N/A |
Detailed Description
The values are taken from the displayed, formatted values (not the true, raw values) in the selected rows of the target grid. The row selection can be manual before launching the script or from the automation script itself. The value sources are identified by the grid column's unique IDs. Then the fetched values replace the variable names in all action parameters that use them.
Example Script
<ytriaAutomation Application="sapio365">
<SetVarListFromGridSelection ListName="GroupList" GroupName="displayName" Type="groupType" Kreator="createdDateTime" Mail="mailEnabled"/>
<!-- 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>