GetXElementNode

This activity is used to get a specific text from a node. It can be used along with the
GetXElementNodeList activity to extract a specific text from a specific node.

Technical Reference

 

INPUT

ListofXElementNode: Specify the variable declared for List<XElement>.

Position: Specify the position for which the text needs to be extracted.

 

 

 

 

MISC

DisplayName: Displays the name of the activity. You can also customize the activity name to help troubleshoot issues faster. This name will be used for logging purposes.

SkipOnError: It specifies whether to continue executing the workflow even if it throws an error. This supports only Boolean value “True or False”. By default, it is set to “False.”

True: Continues the workflow to the next step

False: Stops the workflow and throws an error.

Version: It specifies the version of the XML automation feature in use

 

OUTPUT

XElementNode: Declare a variable here to see the output of the extracted element from the list of elements.

*Mandatory fields to execute the workflow

Use Case

The following activity illustrates on how we can use the GetXElementNode activity
to extract a specific element from a list of elements.Here we are going to extract
the third element from the list of elements. Since we are using this activity along
with the GetXElementNodeList activity, we do not need a scope to perform this
activity.
 

Steps to execute the bot

1.      Drag and drop the GetXElementNodeList activity to the workflow.

2.      Specify the element name and the file path from which the element has to be
 extracted.

3.      Declare a variable in the ListofXElementNode box of the output segment. Here
it is ListXElement.

4.      Now drag and drop the GetXElementNode activity to the workflow.

5.      Specify the ListXElementNode in the input box as ListXElement which is the
 variable declared in the GetXElementNodeList activity.

6.      Enter the position of the text that needs to be extracted. Here it is 3.

7.      Declare a variable here to view the extracted text in the output box. Here it
 is Xelement.

8.      Drag and drop a writelog activity to the workflow.

9.      Enter the input string as Xelement.ToString, since the variable declared above
 is of XElement type and we need to convert it to a string.

10.   Enter the log level as “info”.

11.   Execute the workflow.


The bot executes the activity, extracts the text from the third position of the node
 and gives it in the output box.