How to get element count based on a condition using LINQ in UiPath

Problem statement — We have an XML data file and need to get the count of employees living in ‘Montara’ city

end of the list

Import system.xml and system.xml.linq to the project.

Now, add 2 assign activities to the workflow area and write the following code.

Query to Load XML file

Now, write the query to get the element the elements

Let’s run the code and see the live action

YouTube: How to get element count based on a condition using LINQ in UiPath - YouTube

Code: UiPathSamples/23 - Get element count based on a conditoin using LINQ at main · manojbatra071/UiPathSamples · GitHub

Medium: How to get element count based on a condition using LINQ in UiPath - Manoj Batra - Medium

Happy Automation

@Manoj_Batra ,
Cool stuff :ok_hand:

1 Like

This is the playlist for LINQ to XML, will upload more soon to this.