cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ha3L
Frequent Visitor

XML node datatype in input/output variables

Hi,

Pre-emptive TLDR: is there any way to use XML documents as flow inputs/outputs without it becoming a plain old string and therefore incapable of being parsed as an XML node?

 

I would like to build a set of flows that modify XML documents. Because these different flows share a huge number of operations that are the same but with different parameters, it made sense to turn each modification into its own flow and construct the larger programs (multiple, hence why I didn't just make subflows) by calling a bunch of other flows.

 

I have to pick my problem:

1. Reading from and writing to the XML file in every single "helper function" flow makes the program take 20-30x longer than it should.

2. Copy-pasting the operations to only read and write to the XML file once per program makes it run quick, but it's prone to error if I need to copy and paste literally thousands of commands and modify specific values in the path for each one, and extremely tedious if I need to change the way one of the XML modifications works and go back and change dozens of different flows rather than just the one helper flow.

3. Turning these operations into subflows for each cleans things up but has the same problem of being tedious and if I change the way a helper function works, I need to make that change to many different programs, which is prone to error.

 

Any ways to manage data types for I/O variables that I may not be aware of?

Thanks in advance.

1 ACCEPTED SOLUTION

Accepted Solutions
Gidi
Resolver I
Resolver I

I don‘t see any direct way to use the XML as Input variable in PAD. You can only use a XML-file and the XML-actions (e.g. Read XML from file ) in PAD (see https://docs.microsoft.com/en-gb/power-automate/desktop-flows/actions-reference/xml ).

A good description about handling these actions is here:

https://chercher.tech/power-automate-desktop/xml-automation-power-automate-desktop

View solution in original post

3 REPLIES 3
Gidi
Resolver I
Resolver I

Hi,

with the latest release you have more data types available:

Gidi_0-1657259028427.png

 

see https://flow.microsoft.com/en-us/blog/power-automate-for-desktop-june-2022-update/

ha3L
Frequent Visitor

Thanks for the reply, but I am not sure it helps; is there any way to turn a custom object into an XML node?

If I pass an XML into the function as a variable, set that variable to custom object, and perform XML processing, I get an error saying:

Parameter 'XML document': Argument 'XML document' must be 'XML node'.

I have not yet found a workaround. Please let me know if there is any way to preserve the XML format. Thanks!

Gidi
Resolver I
Resolver I

I don‘t see any direct way to use the XML as Input variable in PAD. You can only use a XML-file and the XML-actions (e.g. Read XML from file ) in PAD (see https://docs.microsoft.com/en-gb/power-automate/desktop-flows/actions-reference/xml ).

A good description about handling these actions is here:

https://chercher.tech/power-automate-desktop/xml-automation-power-automate-desktop

Helpful resources

Users online (4,055)