Create your first automation in just a few minutes.Try Studio Web →
by Mikolaj Zielinski
0
Activity
<100
Summary
Summary
This activity checks if values are present in a DataTable. It returns a Boolean and multiple dictionaries. A boolean variable is True when all values are present and if not, the following dictionaries are created: Present Values, Missing Values, Rest Values.
Overview
Overview
How does it work?
You have to provide two objects:
a) a DataTable in which you have to find values
b) Dictionary with key as String (column name) and value as an array of strings (values which you are looking for)
As a result you can obtain the following output dictionaries:
a) Present dictionary – contains columns with the names and values you were looking for – the matched values.
b) Missing dictionary – contains the names of the columns and values which are missing.
c) Leftovers dictionary – contains the names of the columns and rest values except those which were missing or you were looking for.
d) Find confirmation dictionary – contains the names of columns and True or False values – True when all values from the array were found and False if any of it were missing.
Example:
DT:
Numbers, Cities, Countries, Elements
23, Szczecin, Poland, Iron
8987, Berlin, Germany, Polon
34, Prague, Czech, Hydrogen
231, New York, USA, Oxygen
11, Moscow, Russia, Mercury
1515, Shanghai, China, Chlorine
125, Tokyo, Japan, Iridium
Here are the data which we are looking for:
Numbers: 23, 34, 11
Cities: Berlin, Tokyo
Elements: Mercury, Iron, Oxygen
Here is how our query dictionary is looking like:
Dictionary(3) { { "Numbers", string[3] { "23", "34", "11" } }, { "Cities", string[2] { "Berlin", "Tokyo" } }, { "Elements", string[3] { "Mercury", "Iron", "oxygen" } } }
And here are our results:
a) Present dictionary (Present_dictionary)
Dictionary(3) { { "Numbers", string[3] { "23", "34", "11" } }, { "Cities", string[2] { "Berlin", "Tokyo" } }, { "Elements", string[3] { "Mercury", "Iron", "Oxygen" } } }
b) Missing dictionary (Missing_dictionary)
Dictionary(3) { { "Numbers", string[0] { } }, { "Cities", string[0] { } }, { "Elements", string[0] { } } }
c) Leftovers dictionary (Leftover_dictionary)
Dictionary(3) { { "Numbers", string[4] { "8987", "231", "1515", "125" } }, { "Cities", string[5] { "Szczecin", "Prague", "New York", "Moscow", "Shanghai" } }, { "Elements", string[4] { "Polon", "Hydrogen", "Chlorine", "iridium" } } }
d) Find confirmation dictionary (Found_dictionary)
Dictionary(3) { { "Numbers", true }, { "Cities", true }, { "Elements", true } }
If we would modify our query with some values which are not in table:
Dictionary(3) { { "Numbers", string[3] { "23", "34", "16" } }, { "Cities", string[2] { "Warsaw"__, "Tokyo" } }, { "Elements", string[3] { "Mercury", "Iron", "Oxygen" } } }
Then in b and c, we will get:
B’) Dictionary(3) { { "Numbers", string[1] { "16" } }, { "Cities", string[1] { "Warsaw" } }, { "Elements", string[0] { } } }
C’) Dictionary(3) { { "Numbers", false }, { "Cities", false }, { "Elements", true } }
The step by step manual is available in the documentation in "Powersearch - one-page manual how to use"
Features
Features
The fastest and easiest way to check if the columns in DataTables contain the values which you are looking for. If any of them are not present you will obtain the exact list of missing items.
Additional Information
Additional Information
Dependencies
Microsoft.Activities.Extensions System.Data.DataSetExtensions
Code Language
Visual Basic
Runtime
Windows Legacy (.Net Framework 4.6.1)
License & Privacy
MIT
Privacy Terms
Technical
Version
1.0.0Updated
January 19, 2021Works with
Studio: 20.10.2 - 22.10
Certification
Silver Certified
Support
UiPath Community Support
Resources