Description
Removes a specified key from the specified Dictionary object.
Attributes
Output
Result - True or False boolean result if specified key has been removed from the Dictionary object.
Input
Dictionary - The Dictionary object from which the specified key would be removed.
Key - The Key of the data to be removed.
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
- Create a Dictionary<Int32,Int32> variable and name it dictionary.
- Add an Assign activity inside the initial Sequence.
- In the Assign To field, add the dictionary variable.
- In the Assign Value field, write new Dictionary(Of Int32, Int32) since its default value is null.
- After the Assign activity, add an Add To Dictionary activity.
- In the Add To Dictionary Dictionary field, add the dictionary variable.
- In the Add To Dictionary Key field, write 1.
- In the Add To Dictionary Value field, write 15. This means the Key 1 has the value of 15.
- Add your second Add To Dictionary activity.
- In the Add To Dictionary Dictionary field, add the dictionary variable.
- In the Add To Dictionary Key field, write 2.
- In the Add To Dictionary Value field, write 25.
- After the Add To Dictionary activity, add a Remove From Dictionary activity.
- In the Remove From Dictionary Dictionary field, add the dictionary variable.
- In the Remove From Dictionary Key field, write 2.
The use case should look as the following screenshot:
Upon execution, two keys should be added to the dictionary variable, and then the Key 2 should be removed afterwards.