Description

Verifies if a key exists within a specified Dictionary object.



Attributes

Output

  • Result - True or False boolean result if the specified key exists within the Dictionary object.

Input

  • Dictionary - The Dictionary object whose Key would be checked.

  • Key - The Key to be checked within the specified Dictionary object.

Common

  • ContinueOnError - The Boolean value to specify whether to continue executing the next activities even if there is an error thrown on this activity.

Misc

  • DisplayName - Renames the activity.


Example

  1. Create a Dictionary<Int32,Int32> variable and name it dictionary.
  2. Add an Assign activity inside the initial Sequence.
  3. In the Assign To field, add the dictionary variable. 
  4. In the Assign Value field, write new Dictionary(Of Int32, Int32) since its default value is null.
  5. After the Assign variable, add an Add To Dictionary activity.
  6. In the Add to Dictionary Dictionary field, add the dictionary variable.
  7. In the Add to Dictionary Key field, write 1. 
  8. In the Add to Dictionary Value field, write 15. This means the Key 1 has the value of 15.
  9. Create a Boolean variable and name it output.
  10. After the Add to Dictionary activityadd a Key Exists in Dictionary activity.
  11. In the Key Exist in Dictionary Result field under Attributes, add the output variable.
  12. In the Key Exist in Dictionary Dictionary field, add the dictionary variable.
  13. In the Key Exist in Dictionary Key field, write 4.
  14. After the Key Exist in Dictionary activity, add a Write Line activity. 
  15. In the Write Line Text field, write output.ToString

    The use case should look like the following screenshot:

 


This should be the result in the Output panel: