Question
2
Replies
80
Views
Posted: December 26, 2019
Last activity: January 3, 2020
Closed
Solved
Casting a table/object proxy to a lookup table
I have a nested lookup table: lktContinent->lktCountry
I need to retrieve the nested table and work with it as lktCountry.
How do I cast Table Proxy to the lktCountry lookup table?
When I add another level of nesting: lktContinent->lktCountry->lktCity, I end up with the Object Proxy.
How do I cast Object Proxy to lktCity lookup table?
Appreciate your help on this. Attached is a small project with these tables.
This is a great question. Basically, whenever you encounter a situation where the automation component is returning an object (everything is an object at its core) and you need to operate on its specific type, you must convert that object to its specific type. In the screenshot I've attached, you can see that we are iterating through a DataTable's Rows. Each of these objects is a DataRow, however the Item output from the ListLoop is an object. To "cast" it, I simply create a JumpLabel that accepts a Type DataRow and pass the Item to it. You could use a JumpLabel or even a new automation to do this.
I've attached an updated solution where I made some changes. I apologize for it being in 19.1 as that is all I have installed at the moment.