Page 1 of 1

Passsing private data to external dataset xpath

Posted: Tue Feb 02, 2016 7:14 pm
by samuelm
I have an external xml dataset that contains two component nodes inside of a parent node called components. To simplify we have a job that comes into switch with two PDFs and one xml file containing all information for both. We would like to extract this data and assign it as private data keys for each PDF. Then down the line we can handle each PDF differently based on their private data. Here is the basic structure of the XML:

>ORDER
----->COMPONENTS
----------->COMPONENT
----------------------(all the data for Component 1. Job Name, Quantity, DueDate)
----------->COMPONENT
----------------------(all the data for Component 2. Job Name, Quantity, DueDate)


Before we attempt to pull this data from these nodes. We have already assigned the component number as private data to the PDFs. We get this from the PDF name in the beginning. If I select a node in switch we get the following XML location path. I have bolded the component number:

[Metadata.Text:Path="/soap12:Envelope/soap12:Body/dn:SubmitOrder/dn:Order[1]/dn:Components[1]/dn:Component[1]/dn:Description[1]",Dataset="Xml",Model="XML"]



We attempted to use the private data key in place of this static number so it would be dynamic based on the component of the job. Bolded below:

[Metadata.Text:Path="/soap12:Envelope/soap12:Body/dn:SubmitOrder/dn:Order[1]/dn:Components[1]/dn:Component[[Job.PrivateData:Key="ComponentNumber"]]/dn:Description[1]",Dataset="Xml",Model="XML"]

Although switch gives us an error and tells us that it expects a static number in the brackets and will not allow us to press ok. How can we achieve this?

Re: Passsing private data to external dataset xpath

Posted: Fri Dec 23, 2022 2:25 pm
by nfulton
I am attempting to do the same thing. Is there a solution to this issue?

Re: Passsing private data to external dataset xpath

Posted: Mon Dec 26, 2022 11:20 am
by laurentd
The Variable XPath Repeater app does exactly what you want!