Validates if an item exists within the specified collection.
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.
- Create a List<String> variable and name it fruits.
- Add an Assign activity inside the initial Sequence.
- In the Assign To field, add the fruits variable.
- In the Assign Value field, write new List(Of String) since its default value is null.
- After the Assign activity, add an Add To Collection activity.
- In the Add To Collection Collection field under Attributes, add the fruits variable.
- In the Add To Collection Item field, write "apple".
- Create a Boolean variable called exists.
- After the Add To Collection activity, add an Exists In Collection activity.
- In the Exist In Collection Result field under Attributes, add the exists variable.
- In the Exist In Collection Item field, write "apple".
- After the Exist In Collection activity, add a Write Line activity.
- 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: