Description

Validates if an item exists within the specified collection.



Attributes

Misc

  • Collection - The name of the list where all of the items would be checked.

  • DisplayName - Renames the activity.

  • Item - The item that the user wants to find within a collection.

  • Result - True or False boolean result if an item exists within the collection.

  • TypeArgument - The type assigned to the collection.


Example

  1. Create a List<String> variable and name it fruits.
  2. Add an Assign activity inside the initial Sequence.
  3. In the Assign To field, add the fruits variable.
  4. In the Assign Value field, write new List(Of String) since its default value is null.
  5. After the Assign activity, add an Add To Collection activity.
  6. In the Add To Collection Collection field under Attributes, add the fruits variable.
  7. In the Add To Collection Item field, write "apple".
  8. Create a Boolean variable called exists.
  9. After the Add To Collection activity, add an Exists In Collection activity.
  10. In the Exist In Collection Result field under Attributes, add the exists variable.
  11. In the Exist In Collection Item field, write "apple".
  12. After the Exist In Collection activity, add a Write Line activity.
  13. In the Write Line Text field, write exists.ToString. 

    The use case should look as the following screenshot:



This should be the result in the Output panel: