How to find element at a specific position from XML using LINQ in UiPath

Problem statement — We have an XML data file and need to extract the
element at a specific position entered by the user in a dialog box

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 at a specific position

Here InputNumber is the integer variable entered by the user. As the numbering starts from 0 that is why we subtracted -1 from the Input Number

Let’s run the video and see the live action

YouTube: How to find element at a Specific Position From XML using LINQ in UiPath - YouTube

Medium: How to find element at a specific position from XML using LINQ in UiPath - Manoj Batra - Medium

Code: UiPathSamples/19 - Find Element at a Specific Position From XML using LINQ at main · manojbatra071/UiPathSamples · GitHub

Happy Automation

2 Likes