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.
<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: GreaterThan Examples:
|
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
<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
<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
<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>