Description
Collects a value from a dictionary.
Attributes
Output
Result - True or False boolean result if a value was collected from a dictionary.
Value - The value collected from the specified dictionary.
Input
Dictionary - The Dictionary object whose value would be collected from.
Key - The Key of the value to be collected.
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.
- Under 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 45.
- After your second Add to Dictionary activity, add a Get From Dictionary activity.
- Create an Int32 variable and name it output.
- In the Get From Dictionary Dictionary field, add the dictionary variable.
- In the Get From Dictionary Key field, write 1.
- In the Get From Dictionary Value field under Attributes, add the output variable.
- After the Get From Dictionary activity, add a Write Line activity.
- In the Write Line Text field, write output.ToString.
The use case should look as the following screenshot:
Since the value of Key 1 is 15, this should be the result in the Output panel: