What will the value of the qty variable be after executing the Assign activity?

The following table is stored in a variable called "dt".

What will the value of the qty variable be after executing the Assign activity?

A . 5
B . 10
C . 80
D . null

Answer: C

Explanation:

The Assign activity is used to assign a value to a variable. In this case, the variable is “qty”. The value of the variable will be 80 after executing the Assign activity because the expression in the Assign activity is “dt.AsEnumerable().Where(Function(x)

x(“Item”).ToString.Equals(“mango”)).Select(Function(y) y(“Quantity”)).ToString”. This expression is filtering the data table “dt” for rows where the “Item” column is equal to “mango” and then selecting the “Quantity” column from those rows. Since there is only one row in the data table where “Item” is equal to “mango”, the value of the “Quantity” column in that row is 80. (UiPath Studio documentation)

References:

: [Assign – UiPath Activities].

Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments