Set item アクション in リスト
- 最終更新日2026/01/27
Set item アクション in リスト
You can set an item at the specific position in a list and store the output in a variable using the Set item アクション.
Settings
This アクション sets or replaces the value in the list variable at the specified index and returns the existing value at that specified index before the replacement.
- Select the list variable in which you want to set a value from the List variable list.
- Specify the position in the list where you want to set the item in the Index number field. リスト インデックスは 0 から始まります。リスト内の最初の項目は位置「0」にあり、2 番目の項目は位置「1」にあります。
- Select a variable from the drop-down list in the Replace with field to replace the list variable.
- 出力の格納に使用する変数を [出力を変数に代入] リストから選択します。
Example of using Set item アクション in an automation
In this example, you will create an automation that sets an item at a specific position in a list and stores the output in a variable.
- Create a Bot.
- On the left panel, click Automation.
A list of available Bot and forms is displayed.
- Click Create a bot.
- Enter the Bot name: List_Set_item.
- Click Create and Edit.
- On the left panel, click Automation.
- Create the user-defined variables using the Create variable
(+) icon at the top of the Variables menu. Create the
following variables and enter the values:
-
Inventory_Stock (Type: List, Subtype: String)
- value at 0: Item ID: 1001, Product Name: Blue T-Shirt, Category: Apparel, Current Stock: 100, Reorder Threshold: 90, SupplierID: S001
- Value at 1: Item ID: 1002, Product Name: Running shoes, Category: Footwear, Current Stock: 95, Reorder Threshold: 60, SupplierID: S002
- Value at 2: Item ID: 1003, Product Name: Yoga Mat, Category: Fitness, Current Stock: 20, Reorder Threshold: 10, SupplierID: S003
- Value at 3: Item ID: 1004, Product Name: Coffee mug, Category: Housewares, Current Stock: 150, Reorder Threshold: 140, SupplierID: S004
- Value at 4: Item ID: 1005, Product Name: Backpack, Category: Accessories, Current Stock: 80, Reorder Threshold: 60, SupplierID: S005
-
Updated_Inventory (Type: String)
Default value: Item ID: 1001, Product Name: Phone Case, Category:Accessories, Current Stock: 50, Reorder Threshold: 20, SupplierID: S006
-
Inventory_Stock (Type: List, Subtype: String)
- To set a value at a specified position in a list, double-click or drag the
アクション from the Actions pane.
- In the List variable field, select Inventory_Stock.
- In the Index number field, enter 0 to specify the position in the list you want to set a value.
- Select Updated_Inventory variable from the drop-down list in the Replace with field to replace the list variable.
- To store the output, select SampleString from the Assign the output to variable list field.
- Double click or drag Get item
アクション.
- In the List variable field, select Inventory_Stock.
- In the Index number field, enter 0 to specify the position in the list from where you want to retrieve a value.
- To store the output, select SampleString from the Assign the output to variable list field.
- To print the value, double-click or drag the Message box アクション. Select SampleString from the Enter the message to display field.
- Click Save and then Run.
The Updated_Inventory variable value (Item ID: 1001, Product Name: Phone Case, Category:Accessories, Current Stock: 50, Reorder Threshold: 20, SupplierID: S006) is set at Index 0 in the Inventory_Stock variable. When you use the Get item アクション to retrieve the value at index 0, on run time, the output is displayed as: