"RemoveFromCollection" activity

Created by akaBot Support, Modified on Tue, 24 Dec, 2024 at 3:29 PM by akaBot Support

Here’s an introduction to the "Remove from Collection" activity.


TABLE OF CONTENTS

  1. Activity program name
  2. Description
  3. Properties
  4. How to use


1. Activity program name

System.Activities.Statements.RemoveFromCollection

2. Description

  • For Studio Version 2.0.2.0 and earlier
    Quick Access: Toolbox > Collection > Remove from Collection

  • From Studio Version 2.0.3.0 onward
    Quick Access: Toolbox > System > Collection > Remove from Collection

This activity removes an item from an existing collection.

Notes:

  • Verified on Studio Version: 2.2.0.5
  • Terminology and features may vary slightly depending on the version.


3. Properties


Property itemProperty nameInput fieldsDescription
MiscTypeArgumentDropdown selection

Select any data type

Collection

Enter Value (ICollection<TypeArgument> Type)

Set the collection from which the item will be removed.

PublicCheckbox

Variables and arguments within the activity are logged to a log file and pushed to the Center. (For more details, refer to "About the 'Public' Property".)

ResultEnter Value (Boolean Type)

The result after removing an item from the existing data.

Item

Enter Value (TypeArgument Type)

Set the content to be removed from the collection.

Display nameAnyString

Reflected as the activity name in the Designer Panel.


4. How to use

Here’s an example of using the "Remove from Collection" activity to delete a specific item from data stored in a newly created List type.


First, drag and drop "Assign" from System > Primitives into the workflow and place it appropriately.


In the Properties panel, under Misc > To, enter a variable of type List (in this example, "sample"). Then, in the Value field, input the value. (In this example, enter new List(Of String) From {"A", "B", "C"}).

For information on creating variables, refer to "How to create variables".



Next, drag and drop "Remove from Collection" from System > Collection into the workflow and place it appropriately.


In the Properties panel, click on Misc> TypeArgument and select String.



In the Properties panel:

  • Under Misc > Collection, input the List<String> variable (in this example, "sample").
  • In the Result field, input a Boolean variable (in this example, "result").
  • In the Item field, input either a string or a String variable (in this example, the string "B").


To retrieve the values stored in the List<String>, drag and drop "For Each (Collection)" from System > Control Flow into the workflow and place it appropriately.



In the Properties panel, click on Misc > TypeArgument and select String.



Next, in the Properties panel, under Misc > Values, input the List<String> variable (in this example, "sample").



To verify the execution results, add "Write Line" from System > Custom to the workflow and configure the necessary variables.

In this example, enter item as the value.



Click "Home > Run" or press the F5 key to execute the workflow and open the Output panel.

Verify that out of the three data items "A", "B", and "C", the item "B" set in the "Remove from Collection" activity has been removed, and only "A" and "C" are displayed.



Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article