Skip to main content
Skip table of contents

SetVarListFromCache: Create a list of variables from the SQL cache

Tag: SetVarListFromCache

The SetVarListFromCache creates lists of variables from the values in the SQL cache.

XML
<SetVarListFromCache/>

Tag Attributes

ListName

List name - Required

Type

Object type name - Required (among ‘user, ‘group’, ‘site’, ‘personalsite’, 'serviceprincipal’)

Field

Field name to read from cache (only works with fields that can be used in an RBAC filter)

CacheFilter

SQL formatted ‘where’ condition. – Cannot be used with Where parameter

ex: CacheFilter= "json_extract(min, '$.displayName') = 'Adele Vance'"

Where

Field name used as a filter. The field value in this column is tested against the value set in (where mode). – Ignored if CacheFilter parameter is set.

(Where Mode)

– Ignored if CacheFilter parameter is set.

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

GreaterThan
GreaterOrEquals
LessThan
LessOrEquals

Examples:

  • Begins="abcd"

  • IsIn ="abcd:efgh" true if the value returned by where is "efgh" but false if "ef"

Unique

True: Only keep unique variable sets

Verbose

When set to TRUE, displays a console trace for each element added to the list

Defaults o FALSE

Example Script

XML
<ytriaAutomation Application="sapio365">
	<SetVarListFromCache Type="user" ListName="UserList" Field="id" CacheFilter="json_extract(min, '$.displayName') = 'Adele Vance'"/>
	<!-- loop on the generated list -->
	<loop list="UserList">
		<ExecuteListAction/> <!-- Does a <SetVar/> with the attributes in SetVarListFromGridSelection except 'ListName' and 'Target' -->
		<echo value="User id is {%id%}."/>
	</loop>
</ytriaAutomation>


Example Script 2

XML
<ytriaAutomation Application="sapio365">
	<SetVarListFromCache Type="user" ListName="UserList" Field="id" CacheFilter="json_extract(min, '$.displayName') = 'Adele Vance'"/>
	<!-- loop on the generated list -->
	<loop list="UserList">
		<ExecuteListAction/> <!-- Does a <SetVar/> with the attributes in SetVarListFromGridSelection except 'ListName' and 'Target' -->
		<echo value="User id is {%id%}."/>
	</loop>
</ytriaAutomation>

Example Script 3

XML
<ytriaAutomation Application="sapio365">
	<SetVar UserEmail="adeleV@tenant.onmicrosoft.com"/>
	<SetVarListFromCache Type="user" ListName="UserList" Field="id" CacheFilter="USE_CDATA">
		<![CDATA[lower(min) LIKE lower('%"{%UserEmail%}"%') OR lower(list) LIKE lower('%"{%UserEmail%}"%') OR lower(list) LIKE lower('%:{%UserEmail%}"%')]]>
	</SetVarListFromCache>
	<!-- loop on the generated list -->
	<loop list="UserList">
		<ExecuteListAction/> <!-- Does a <SetVar/> with the attributes in SetVarListFromGridSelection except 'ListName' and 'Target' -->
		<echo value="User id is {%id%}."/>
	</loop>
</ytriaAutomation>

JavaScript errors detected

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

If this problem persists, please contact our support.