100981
(100981)
September 20, 2022, 9:31am
1
hello,
I have to work with a dropdownmenu which doesn’t work with “Select Item”.
I would like to check if the value I am looking for does not exists in the dropdownmenu.
I have used a find children with the result in an IEnumerable.
How do I check if the value I am looking for does not exists in this IEnumerable?
For example: the dropdownmenu had the options BLUE, RED and YELLOW.
I want to check if there is an option calles BLACK. Than I can take further actions.
Many thanks in advance!
ppr
(Peter Preuss)
September 20, 2022, 9:33am
2
100981:
BLACK
Give a try at:
FindChildrenOutPutVar.Any(Function (x) x.Get("innertext").toString.Trim.ToUpper.Equals("BLACK"))
100981
(100981)
September 20, 2022, 9:48am
3
The IEnumerable is ienumColor. Where do I have to place it?
ppr
(Peter Preuss)
September 20, 2022, 9:52am
4
Please share some more details with us, as from the description Find Children was mentioned.
Screenshot from find children
elaboration on some more details from Flow/Use Case
find children output vs. Color Enum
100981
(100981)
September 20, 2022, 10:00am
5
OK, the real case is somewhat different than the example (with the colors) I gave above.
I have to find a country in a dropdownlist.
Properties of Find Children:
So I would like to check if the country BELGIUM (strTarget) exists in ienumRegion (it does not exists).
ppr
(Peter Preuss)
September 20, 2022, 10:01am
6
just be always close to the case:
FindChildrenOutPutVar.Any(Function (x) x.Get("innertext").toString.Trim.ToUpper.Equals("BELGIUM"))
Or with variable:
FindChildrenOutPutVar.Any(Function (x) x.Get("innertext").toString.Trim.ToUpper.Equals(strTarget.ToUpper.Trim))
100981
(100981)
September 20, 2022, 10:02am
7
but do I use this in an Assign-activity or in an If-activity?
Hi @100981 ,
Try performing a Debug and Check the ienumRegion
variable values through the immediate panel and send screenshots of it.
It would help us to identify the attributes and provide the appropriate attribute for selection.
ppr
(Peter Preuss)
September 20, 2022, 10:03am
9
statement is returning a boolean, so you can assign the return to a Boolean variable or use it within a condition e.g. IF Activity as you do need
About LINQ and the Any Operator has a look here:
Introduction
The “Any” operator is one of the quantifier operators in LINQ used to check if at least one element of a collection satisfies a given condition or not. If the condition is satisfied for at least one item within the collection, the outcome of the Any operator is true. Otherwise, the outcome from the Any operator is false.
The evaluation condition must be mandatory to return a Boolean outcome. In other words: The result of the condition has to be True or False.
API Details <a c…
system
(system)
Closed
September 27, 2022, 9:06am
10
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.