Find Children_Get Attribute activity: Retrieving value of a descendant attribute

Hello All,

I want to retrieve value only for descendant attribute only. (“id”- this attribute is available in immediate child as well as Descendant, however with different values). I want the value for “id” only for descendant.

I’m using Find Children activity using scope Find_Descendants and then get attribute to get a particular attribute(“id” in this case) value. Although It is giving me value for “id” for both child and descendant (please see the sample output), however I’m looking to get value directly for Descendant only (e.g. 1, 2, 4, 5 etc.) Let me know is there a way. PFA screenshots for the reference


Hello @Nishant_mantri ,

One logical solution to the query can be to subtract the List outputs.
eg.
Find Children using Scope as Children op: ListUiEle_Children
Find Children using Scope as Descendants: ListUiEle_Descendats

Then remove the first collection from second one :slight_smile:
ListUiEle_Descendats.Except(ListUiEle_Children)

This is just a pseudo code for the logic,
hope you get the idea.

Regards
Ankit K

Check if you can configure the filter for the Find Children activity so that only the descendant elements are included.

Find / Children | Find_Scope: FIND_DESCENDANTS | Filter: <webctrl tag='PATH' /> - out: myChildren

Looping / retrieval myChildren | for each / LINQ
e.g. LoopVar = myUiItem

Attribute / Value Retrieval

using myUiItem within a Get Attribute OR
myItem.Get(“AttributeName”).toString

Attributes
id=1
name=Alabama

Thanks but now i could see that there are more descendants with “id” attribute (please see attached screenshots). So now i’m getting value for the attribute “id” for all the descendants… Please see the sample output. I’m just interested in value of attribute (1, 2,4,5,6 etc.) of the first descendants. Is there a way to get this.



Thanks but now i could see that there are more descendants with “id” attribute (please see attached screenshots). So now i’m getting value for the attribute “id” for all the descendants… Please see the sample output. I’m just interested in value of attribute (1, 2,4,5,6 etc.) of the first descendants. Is there a way to get this.

on the one side, we don’t know the details whats was done at your end
on the other side, we cannot refer to all the details from the screenshots

maybe with some additional attributes the filtering can be more fintuned

coming back to:

a combined / nested find children and limited grabbing of inner elements may can alow to extract the needed dertails

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