How to create an RPA Flow using Invoke Method activity with System.Xml.XmlDocument
Intermediate | 35 Minutes
Overview
The Invoke Method activity in Infor RPA allows you to execute methods from .NET classes directly within your automation flows. This powerful feature enhances flexibility by enabling automation of complex tasks beyond standard activities. It also promotes reusability, allowing you to leverage existing .NET libraries and code, reducing duplication and ensuring consistency across systems and applications. By integrating .NET methods, you can simplify intricate operations that involve advanced logic or multiple steps while maintaining efficiency and consistency across automation projects.
In this tutorial, we will focus on using the Invoke Method activity with the System.Xml.XmlDocument class from the .NET Framework. The XmlDocument class provides methods for working with XML data, including loading XML, selecting nodes, and retrieving node values.
We will start by reading a TXT file containing an XML structure, then load the XML string into an XmlDocument object, select a specific XML node, and retrieve its value.
📋 Requirements
JavaScript |
Key Components for using Invoke Method for XML document
|
Tutorial
Flow Improvement
If you want to write the values from the XML file into a text file at the end of the process to make sure they have been properly recorded, you can add an Append Line activity to the end of the flow.
- Line use the following expression xmlDoc.OuterXml
- Source Filepath specify the path of the file “C:\RPA\Example.txt“
Next Save and run the flow. You can then check the Example.txt file for the results.
What made this section unhelpful for you?
On this page
- How to create an RPA Flow using Invoke Method activity with System.Xml.XmlDocument