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’) |
|
(variable names) |
Any unreserved name is valid in XML. Reserved names are listed here: Variables |
|
(Variable Values) |
Valid field names. e,g, v_ID='id'
|
|
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 "Any variable name": Only keep sets with a unique value for this variable |
|
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" v_Id="id" v_UPN="userPrincipalName" Where="displayName" Equals="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 {%v_Id%}."/>
<echo value="User UPN is {%v_UPN%}."/>
</loop>
</ytriaAutomation>
Example Script 2
<ytriaAutomation Application="sapio365">
<SetVarListFromCache Type="user" ListName="UserList" v_Id="id" v_UPN="userPrincipalName" 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 {%v_Id%}."/>
<echo value="User UPN is {%v_UPN%}."/>
</loop>
</ytriaAutomation>
Example Script 3
<ytriaAutomation Application="sapio365">
<SetVar UserEmail="adeleV@tenant.onmicrosoft.com"/>
<SetVarListFromCache Type="user" ListName="UserList" v_Id="id" v_UPN="userPrincipalName" 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 {%v_Id%}."/>
<echo value="User UPN is {%v_UPN%}."/>
</loop>
</ytriaAutomation>