Create an XML file

Is there any way to create an xml file or is there any library for creating an xml file in UiPath Studio? Right now I am just appending the xml content to file with the append activity. But that will not be good solution when the automation solution grows.

Thanks

Hi,

You can use XDocument / XElement Class etc in System.Xml.Linq namespace.
If you already have an xml file, you can deserialize to XDocument class using Deserialize XML activity in UiPath.Web.Activities Package (UiPath.WebAPI.Activities Package), vice versa.

The following link might also help you.

Regards,

1 Like

Thanks @Yoichi. That is a good idea to look on.

So this needs to be done with invoke code activity. Is there any way to create a generic functional block and just call with parameters when required. Just to minimize the line of code and complexity

Create a library with your code.

Hi,

It’s doesn’t always have to use Invoke code activity. Usually we use Assign activity and Invoke Method activity for it. And it’s good to create a workflow to handle XML and call it using Invoke Workflow file activity.

The following is a sample for handling XML without Invoke Code. (It requires Web.Activity.Package to deserialize)

Regards,

1 Like

I understood. Thanks to @Yoichi @KannanSuresh both of you.

I will create a solution combining both of your ideas.

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.