Skip to main content
Skip table of contents

SelectFromList: Select Rows From List

Tag: SelectFromList

The SelectFromList function selects rows in a grid from values stored in a list of SetVar actions.

XML
<SelectFromList ListName="O365GroupList">
	<SetParam columnID="groupType" value="GType"/>
</SelectFromList>

Detailed Description

Values set in SetVar actions that are added to a list can be used as row selection keys.

Each row value in the target column is compared to the variable value for each entry in the list.

When there is a match, the row is selected.

Tag Attributes

Attributes

Attribute Values

Value Description

Target

Applicable Grid Code

N/A - Not Required (See detailed description)

ListName

Name of list to use as source of values by which to match rows.

N/A - Required

The list must contain SetVar actions only.

Inside the action, SetParam entries will set the ColumnID and variable name from the list to be used as reference in the Value parameter:

SetParam Options

Attributes

Attribute Values

Value Description

ColumnID

The corresponding Column ID as shown in the Grid Manager

A valid column ID whose value for each row is tested against the reference value

or

$PK$ to assign the grid Primary Key of the row as the tested row value 

Value

Variable name from the list to be used as reference.

Required (See detailed description)

XML
<SetParam columnID="MyColumnID" value="MyListVariable"/>

NB: When using $PK$ as the column ID, the reference list variable must be formatted according to pk syntax, or set by SetVarListFromgridSelection.

CODE
<List name="O365GroupList" Action="SetVar" MyListVariable="|*pk*|id|*==*|c2a7bff1-8095-40fd-ae4c-0ddab18aab86"/>
<List name="O365GroupList" Action="SetVar" MyListVariable="|*pk*|id|*==*|885e57b8-dad3-4d48-9e4f-62faf0122b9b"/>

<SelectFromList ListName="O365GroupList">
	<SetParam columnID="$PK$" value="MyListVariable"/>
</SelectFromList>


More than one pair of column ID / variable name can be used. They are combined with and AND (as in a regular select with SetParam actions combine with And="true" - cf Select: Select Rows

Example Script

 Example 1: In sapio365 / Group Module, select all rows where where the group type column value matches Distribution list or Security Group or Marketing...

XML
<ytriaAutomation>	
	<List name="O365GroupList" Action="SetVar" GType="Distribution list"/>
	<List name="O365GroupList" Action="SetVar" GType="Security Group"/>
	<List name="O365GroupList" Action="SetVar" GType="Marketing"/>
	<SelectFromList ListName="O365GroupList">
		<SetParam columnID="groupType" value="GType"/>
	</SelectFromList>
</ytriaAutomation>

Example 2: In sapio365 / Group Module, select all rows where where the group type and display name annotation column values match Distribution list and ABC, or Security Group and XYZ, or Distribution list and jambon:

XML
<ytriaAutomation Console="True" KeepAlive="True">
	<List name="O365GroupList" Action="SetVar" GType="Distribution list" Comment="This a comment about the distribution list"/>
	<List name="O365GroupList" Action="SetVar" GType="Security Group" Comment="This a comment about the security group"/>
	<List name="O365GroupList" Action="SetVar" GType="Distribution list" Comment="Another comment about the distribution list"/>
	<SelectFromList ListName="O365GroupList">
		<SetParam columnID="groupType" value="GType"/>
		<SetParam columnID="displayName-A" value="Comment"/>
	</SelectFromList>
</ytriaAutomation>
Only SetVar Select Row from list
JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.