I’m trying to populate a TextBox’s default value based on the selected item from a Dropdown using Lookup. But for some reason the Expression is not valid.
I’ve even tried to make the expression simple by using a fixed value, here the expression I’m using:
The Lookup function is not a built-in activity or method in UiPath for directly looking up values from a collection.
You can use Assign activity where you set your TextBox’s default value.
In the Value property of the Assign
the expression should be
(From row In Employees.AsEnumerable() Where row(“FirstName”).ToString().Equals(“Jack”) Select row(“LastName”).ToString()).FirstOrDefault()
Make sure your Employees DataTable is in scope and contains the necessary columns (FirstName and LastName).
Employees is the Entity Name, EmployeesTBL is the table object name in the MainPage. In my App there is no DataTable variable.
I’ve tried the expression you shared but I got another error. I’ve replaced Employees with EmployeesTBL and still have the same error.
Thanks a lot for the detailed steps in the video, it was very informative and to the point.
I have a question, what is the difference between lookup and fetch functions?