Loop through the "Form Section" and then select those forms and get data from the selected forms and write the data into excel with form name

a) When I click on “W-2” Form names will appear. Those names are dynamic. There can be one or more than one form.
I dont want that last part “Add new Employee”.

MicrosoftTeams-image (120)

When I click on any form there are templates which are same.

b) I want to extract those data from the template.
MicrosoftTeams-image (121)

c) I just want to write in to excel in particular format in excel below:
MicrosoftTeams-image (122)

I tried using find children but Im getting duplicate names of forms such as w10, w-10
w-11, w-11

How should I do it please help.
Thankyou

@Bhushan_Nagaonkar

Did you try with for each ui element activity?

and inside use if condition to ignore

cheers

What will be the condition inside if?

Hey @Bhushan_Nagaonkar,

In the ‘For Each UiElement’ activity, the UiElements will be stored in a variable.
You can then use ‘Get Attribute’ activity to get the ‘aaname’ of the UiElement from this variable.
You can then compare the ‘aaname’ with the name you want to click.
Finally, you can use the ‘Click’ activity where the input for the click activity would be the variable that stores the UiElement.

@Bhushan_Nagaonkar

Not CurrentElement.Get("Innertext").ToString.Equals("Add new Employer")

something on these lines

cheers

Actually name will be different.
it wont be the given name. “Add Employer name” will be same and we dont want to click that.

I tried using highlight and find relative element using offset distance but sometimes it clicks two sometimes.

Overview is that.
“W-2” and “Add employee Name” will remain the same but the name and form number will change.
I want to click in those form and get data.

Hey @Bhushan_Nagaonkar, You can check if the UiElement(aaname or innertext) contains or is equal to “w10/w11”. If it does then you can click that specific UiElement.

But what if the name keeps on changing it should click on every single form and stop at “Add Employer Name”. There can be 20 forms or one form it should click on those. I tried ui eelemnt but not working

@Bhushan_Nagaonkar, Try using the find children activity. It will give you a collection of all the elements that may be present in the W-2 Folder

Check this video out for reference:
UiPath Find Children Activity | Select values from Dropdown| Select Item | Example | Selectors | RPA - Bing video

The selectors are same.
<webctrlaria-label=‘W-2’id=’-label’tag=‘SPAN’
<webctrlaria-label=‘w-10’id=’-label’tag=‘SPAN’

What does -label mean

It’s used to identify the elements.