How to add uielements to a list using invoke method?

I am using the find children activity to extract hyperlinks from a table. However i would like to be able to add the hyperlinks in a list using the invoke method function later so how should i do that? each of the hyperlinks are of type UiPath.core.uielement

Assumption: find children did filtered on a elements only

we can do within a single assign Activity
arrLinks | String Array =
YourFindChildrenOutVar.Select(Function (x) x.Get("href").toString.Trim).ToArray()

I think they want the uielements themselves in the list not the URLs. That way they can be used as input elements for other activities.

lets wait for the OP to get it cleared

as FindChildren is an IEnumerable(of UiElement)

myList = YourFindChildrenOutVar.ToList()

1 Like

yeah i need the uielements themselves as the URL’s cannot be naivgated to. So i need to add each of the uielements into a list so that i can click it later. But im not able to figure out the target type or what input parameter to pass in the invoke method activity using the Add method. Im still new to UiPath so any help is appreciated

yes so i want to add the uielements themselves to a list, not the URL’s. what variable type should i use for that list and is it possible to do it with an invoke method activity?

As mentioned we can do within a single assign Activity as well ( no need for loop and invoke method)

DataType definition of the variable:

grafik
grafik
grafik

ok, ok

Result:
grafik

1 Like

@tejas.ma
Thanks for your PMs

Consolidation of the different find children

you can use a single find children only:

Selector - let point it to the DataTable
Filter - <webctrl tag='A' />
Find / Scope: FindScope_DESCENDANTS

Merging Loop Find children to aggregated list:

Preparation / Variable Definition:

myList | List(Of UiElement) | DefaultValue: new List(of UiElement)()

Merging:

then use an assign Activity
myList = myList.Concat(YourFindChildrenOutPutVar).ToList()

HowTos:

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.