Skip to main content
Skip table of contents

UserInput script examples

XML
<ytriaAutomation>
    <Echo Mode="false"/>
 
    <list Name="UserList" Action="SetVar" UserListValue="3ea080a4-06d0-4eff-8ecf-f3935c6ca6be"/>
    <list Name="UserList" Action="SetVar" UserListValue="f3b9bd53-8437-4c35-b558-edc809b60315"/>
    <list Name="SingleUser" Action="SetVar" SingleUserValue="f3b9bd53-8437-4c35-b558-edc809b60315"/>
    <list Name="GroupList" Action="SetVar" GroupListValue="92b8e4be-5ffa-4fc4-940e-8fa7c69e60e5"/>
    <list Name="GroupList" Action="SetVar" GroupListValue="2c0c10b9-23a0-4bf9-ba6f-55b08de0a8bf"/>
    <list Name="SingleGroup" Action="SetVar" SingleGroupValue="2c0c10b9-23a0-4bf9-ba6f-55b08de0a8bf"/>
 
    <list Name="OPUserList" Action="SetVar" OPUserListValue="a0c18953-0524-46d3-aaa4-034322733499"/>
    <list Name="OPUserList" Action="SetVar" OPUserListValue="6a1355af-6d91-433b-a091-d6f51d09e511"/>
    <list Name="SingleOPUser" Action="SetVar" OPSingleUserValue="6a1355af-6d91-433b-a091-d6f51d09e511"/>
    <list Name="OPGroupList" Action="SetVar" OPGroupListValue="1298814e-8de3-4b96-be96-d88e2ab8603f"/>
    <list Name="OPGroupList" Action="SetVar" OPGroupListValue="0c9e4fd0-4152-4385-aaa6-9149e6b9a8ec"/>
    <list Name="SingleOPGroup" Action="SetVar" OPSingleGroupValue="0c9e4fd0-4152-4385-aaa6-9149e6b9a8ec"/>
 
    <UserInput Title="User Input example" ButtonTextOK="OK button" ButtonTextCancel="Cancel button">
            <Variable Name="ACategory" Type="Category" Label="A Category" Expand="True"/>
            <Variable Name="Label" Type="Label" Label="This is a Label with an icon and a color" Color="#FFE8E5" Icon="fas fa-info-circle"/>
            <Variable Name="Text" Value="This is a Text" Label="Text" Tooltip="Text tooltip"/>
            <Variable Name="ReadOnlyText" Type="Text" Label="Text (Read-only)" Value="This is a read-only Text" Tooltip="Read-only Text tooltip" Readonly="true"/>
            <Variable Name="Bool"  Type="Bool" Label="Bool" Value="true" Tooltip="Bool tooltip"/>
            <Variable Name="BoolToggle" Type="BoolToggle" Label="BoolToggle" Value="false" Tooltip="BoolToggle tooltip"/>
            <Variable Name="DateAny"  Type="Date" Label="Date" Value="{%Date%}" Tooltip="Date tooltip"/>
            <Variable Name="DateInPast" Type="DateInPast" Label="DateInPast" Value="1991-07-21" Tooltip="DateInPast tooltip"/>
            <Variable Name="Integer" Type="Integer" Label="Integer" Value="365" Tooltip="Integer tooltip" Min="300" Max="365"/>
            <Variable Name="MandatoryInteger" Type="Integer" Label="Integer (Mandatory)" Value="2" Tooltip="Mandatory Integer tooltip" Min="1" Max="3" Mandatory="true"/>
            <Variable Name="Number" Type="Number" Label="Number" Value="365.99" Tooltip="Number tooltip"/>
             
            <Variable Name="AnotherCategory" Type="Category" Label="Another Category" Expand="True"/>
            <Variable Name="List" Type="List" Label="List" Value="List item 1" Tooltip="List tooltip">
                <ListItem Value="List item 1"/>
                <ListItem Value="List item 2" Label="Label for List item 2"/>
                <ListItem Value="List item 3"/>
                <ListItem Value="List item 4"/>
            </Variable>
            <Variable Name="RadioList" Type="RadioList" Label="RadioList" Value="Radio List item 2" Tooltip="RadioList tooltip">
                <ListItem Value="RadioList item 1"/>
                <ListItem Value="RadioList item 2"/>
                <ListItem Value="RadioList item 3"/>
                <ListItem Value="RadioList item 4"/>
            </Variable>
            <Variable Name="CheckList" Type="CheckList" Label="CheckList" Tooltip="CheckList tooltip" ListName="TheCheckList" HasSelectAll="true">
                <ListItem Value="CheckList item 1"/>
                <ListItem Value="CheckList item 2"/>
                <ListItem Value="CheckList item 3" Select="true"/>
                <ListItem Value="CheckList item 4"/>
            </Variable>
            <Variable Name="NoCheckboxList" Type="NoCheckboxList" Label="NoCheckboxList" Tooltip="NoCheckboxList tooltip">
                <ListItem Value="NoCheckboxList item 1"/>
                <ListItem Value="NoCheckboxList item 2"/>
                <ListItem Value="NoCheckboxList item 3"/>
                <ListItem Value="NoCheckboxList item 4"/>
            </Variable>
            <Variable Name="MultiList" Type="MultiList" Label="MultiList" Tooltip="MultiList tooltip" ListName="TheMultiList">
                <ListItem Value="MultiList item 1"/>
                <ListItem Value="MultiList item 2"/>
                <ListItem Value="MultiList item 3"/>
                <ListItem Value="MultiList item 4" Select="true"/>
            </Variable>
            <Variable name='FolderPath' Type='FolderPath' Label='FolderPath' Value="C:\Temp" Tooltip="FolderPath tooltip"/>
            <Variable name='FilePath' Type='InputFilePath' Label='InputFilePath' Value="C:\Temp\file.text" Tooltip="InputFilePath tooltip"/>
            <Variable name='OutputFilePath' Type='OutputFilePath' Label='OutputFilePath' Value="C:\Temp\file.text" Tooltip="OutputFilePath tooltip"/>
 
            <Variable Name="sapio365Specific" Type="Category" Label="sapio365 specific"/>
            <Variable Name="UserListValue" ListName="UserList" Label="MultiUserSelection" Type="MultiUserSelection">
                <ListItem ListName="UserList" Value="UserListValue"/>
            </Variable>
            <Variable Name="SingleUserValue" ListName="SingleUser" Label="OneUserSelection" Type="OneUserSelection">
                <ListItem ListName="SingleUser" Value="SingleUserValue"/>
            </Variable>
            <Variable Name="GroupListValue" ListName="GroupList" Label="MultiGroupSelection" Type="MultiGroupSelection">
                <ListItem ListName="GroupList" Value="GroupListValue"/>
            </Variable>
            <Variable Name="SingleGroupValue" ListName="SingleGroup" Label="OneGroupSelection" Type="OneGroupSelection">
                <ListItem ListName="SingleGroup" Value="SingleGroupValue"/>
            </Variable>
            <Variable Name="OPUserListValue" ListName="OPUserList" Label="MultiOnPremUserSelection" Type="MultiOnPremUserSelection">
                <ListItem ListName="OPUserList" Value="OPUserListValue"/>
            </Variable>
            <Variable Name="SingleOPUserValue" ListName="SingleOPUser" Label="OneOnPremUserSelection" Type="OneOnPremUserSelection">
                <ListItem ListName="SingleOPUser" Value="SingleOPUserValue"/>
            </Variable>
            <Variable Name="OPGroupListValue" ListName="OPGroupList" Label="MultiOnPremGroupSelection" Type="MultiOnPremGroupSelection">
                <ListItem ListName="OPGroupList" Value="OPGroupListValue"/>
            </Variable>
            <Variable Name="SingleOPGroupValue" ListName="SingleOPGroup" Label="OneOnPremGroupSelection" Type="OneOnPremGroupSelection">
                <ListItem ListName="SingleOPGroup" Value="SingleOPGroupValue"/>
            </Variable>
    </UserInput>
     
    <Echo Value="Text value is: {%Text%}"/>
    <Echo Value="Bool value is: {%Bool%}"/>
    <Echo Value="BoolToggle value is: {%BoolToggle%}"/>
    <Echo Value="Date value is: {%DateAny%}"/>
    <Echo Value="DateInPast value is: {%DateInPast%}"/>
    <Echo Value="Integer value is: {%Integer%}"/>
    <Echo Value="Mandatory Integer value is: {%MandatoryInteger%}"/>
    <Echo Value="Number value is: {%Number%}"/>
    <Echo Value="List value is: {%List%}"/>
    <Echo Value="RadioList value is: {%RadioList%}"/>
    <Loop list="TheCheckList">
        <ExecuteListAction/>
        <Echo value="CheckList contains: {%CheckList%}"/>
    </Loop>
    <Loop list="TheMultiList">
        <ExecuteListAction/>
        <Echo value="MultiList contains: {%MultiList%}"/>
    </Loop>
    <Echo Value="FolderPath value is: {%FolderPath%}"/>
    <Echo Value="InputFilePath value is: {%FilePath%}"/>
    <Echo Value="OutputFilePath value is: {%OutputFilePath%}"/>
    <Loop list="UserList">
        <ExecuteListAction/>
        <Echo value="MultiUserSelection contains: {%UserListValue%}"/>
    </Loop>
    <Loop list="SingleUser">
        <ExecuteListAction/>
        <Echo value="OneUserSelection contains: {%SingleUserValue%}"/>
    </Loop>
     <Loop list="GroupList">
        <ExecuteListAction/>
        <Echo value="MultiGroupSelection contains: {%GroupListValue%}"/>
    </Loop>
    <Loop list="SingleGroup">
        <ExecuteListAction/>
        <Echo value="OneGroupSelection contains: {%SingleGroupValue%}"/>
    </Loop>
    <Loop list="OPUserList">
        <ExecuteListAction/>
        <Echo value="MultiOnPremUserSelection contains: {%OPUserListValue%}"/>
    </Loop>
    <Loop list="SingleOPUser">
        <ExecuteListAction/>
        <Echo value="OneOnPremUserSelection contains: {%SingleOPUserValue%}"/>
    </Loop>
     <Loop list="OPGroupList">
        <ExecuteListAction/>
        <Echo value="MultiOnPremGroupSelection contains: {%OPGroupListValue%}"/>
    </Loop>
    <Loop list="SingleOPGroup">
        <ExecuteListAction/>
        <Echo value="OneOnPremGroupSelection contains: {%SingleOPGroupValue%}"/>
    </Loop>
 
</ytriaAutomation>

Console output after OK

Example using an explicit List and a List from SetVarListFromGridSelection to populate a combo box (List type)

XML
<ytriaAutomation Application="sapio365">
    <!-- to be launched from a groups view with a selection of rows -->
    <!--
    Generate a List of SetVar from the current selection in the grid:
    - Set list name and target grid (target is not needed in sapio365 or main grids in Notes products)
    - Add variable names connected to grid column unique IDs (shown in grid's Column Map) to store grid values into
    In this example "displayName", "groupType", "id", "mailEnabled" are column unique IDs from the sapio365 Groups grid:
    -->
    <Echo Mode="False"/>
    <SetVarListFromGridSelection ListName="GroupList" MyListGroupName="displayName" MyListType="groupType" MyListGroupId="id" MyListMail="mailEnabled"/>
    <List Name="TheList" Action="SetVar" ListItemLabel="List Item Value 1" ListItemValue="listItemValue1"/>
    <List Name="TheList" Action="SetVar" ListItemLabel="List Item Value 2" ListItemValue="listItemValue2"/>
    <List Name="TheList" Action="SetVar" ListItemLabel="List Item Value 3" ListItemValue="listItemValue3"/>
    <List Name="TheList" Action="SetVar" ListItemLabel="List Item Value 4" ListItemValue="listItemValue4"/>
    <!-- now use these two lists in an input dialog -->
    <UserInput Title="User Input example with lists">
        <Variable Name="Groups" Label="Group stuff" Tooltip="Test combo items from SetVarListFromGridSelection" Type="List">
            <ListItem ListName="GroupList" Label="MyListGroupName" Value="MyListGroupId"/>
        </Variable>
        <Variable Name="ListCombo" Label="List stuff" Tooltip="Test combo items from List" Type="List">
            <ListItem ListName="TheList" Label="ListItemLabel" Value="ListItemValue"/>
        </Variable>
    </UserInput>
    <Echo Value="Groups selection is {%Groups%}"/>
    <Echo Value="List Combo selection is {%ListCombo%}"/>
</ytriaAutomation>

After OK is clicked, the selected items in each component will be stored in an automation LIST that must be used in a LOOP (even if the selection contains a single item), and whose action is SetVar. Each entry in the check list has a value and a label which can be identical.

The list named after the value set for the ListName parameter in the Variable, contains the list of selected item values (not labels).

Example using a List from SetVarListFromGridSelection to populate a list of checkboxes (CheckList type)

In the example below, UserList is first created from the grid selection (with SetVarListFromGridSelection ), then used as input in the variable varFromGridSelection. The entries later selected in the dialog are put into a new list named USERcheckList.

When USERcheckList is iterated in a loop, each ExecuteListAction sets the variable varFromGridSelection to the current value from USERcheckList.

If the user selection contains no item, the list doesn't exist and using it in a Loop will result in an error. Make the variable Mandatory to force at least one selection.

XML
<ytriaAutomation>
    <Echo Mode="False"/>
    <Select Lines="all"/>
    <SetVarListFromGridSelection ListName="UserList" Username="displayName" Email="userPrincipalName"/><!-- create list from grid selection (all rows) with values from the displayName
    and userPrincipalName columns-->
 
    <!-- hardcoded list -->
    <List Name="ListForCheckList" Action="SetVar" ListItemLabel="Checklist Item Value 1" ListItemValue="checkListItemValue1"/>
    <List Name="ListForCheckList" Action="SetVar" ListItemLabel="Checklist Item Value 2" ListItemValue="checkListItemValue2"/>
    <List Name="ListForCheckList" Action="SetVar" ListItemLabel="Checklist Item Value 3" ListItemValue="checkListItemValue3"/>
    <List Name="ListForCheckList" Action="SetVar" ListItemLabel="Checklist Item Value 4" ListItemValue="checkListItemValue4"/>
 
    <Userinput Title="User Input example with list from grid">
        <Variable Name="varFromGridSelection" ListName="USERcheckList" Type="CheckList" Label="Select User:" Tooltip="Grid list selector"><!-- check list from grid selection -->
            <ListItem ListName="UserList" Value="Email" Label="Username" Select="true"/><!-- Select="true": all items selected by default -->
        </Variable>
        <Variable name="varFromHarcodedList" ListName="ScriptListCheckList" Type="CheckList" Label="Select from List:" Tooltip="Harcoded list selector" Mandatory="true"><!-- check list from
        hardcoded list -->
            <ListItem ListName="ListForCheckList" value="CheckListItemValue" label="CheckListItemLabel"/>
        </Variable>
        <Variable name="varFromDlg" ListName="MyCheckList" Type="MultiList" Label="Select from My List:" Tooltip="My list selector"><!-- check list from a new list -->
            <ListItem Value="My Checklist Item Value 1" Select="true"/>
            <ListItem Label="My Checklist Item Value 2" Value="myCheckListItemValue2"/>
            <ListItem Label="My Checklist Item Value 3" Value="myCheckListItemValue3"/>
            <ListItem Label="My Checklist Item Value 4" Value="myCheckListItemValue4" select="true"/>
            <ListItem Label="My Checklist Item Value 5" Value="myCheckListItemValue5"/>
        </Variable>
    </Userinput>
 
    <Loop List="USERcheckList">
        <ExecuteListAction/>
        <Echo Value="Selected user: {%varFromGridSelection%}"/>
    </Loop>
    <Loop List="ScriptListCheckList">
        <ExecuteListAction/>
        <Echo Value="Selected from List: {%varFromHarcodedList%}"/>
    </Loop>
    <Loop List="MyCheckList">
        <ExecuteListAction/>
        <Echo Value="Selected from My List: {%varFromDlg%}"/>
    </Loop>
</ytriaAutomation>

JavaScript errors detected

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

If this problem persists, please contact our support.