Passsing private data to external dataset xpath

Post Reply
samuelm
Newbie
Posts: 4
Joined: Mon May 04, 2015 8:52 pm

Passsing private data to external dataset xpath

Post 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?
nfulton
Newbie
Posts: 10
Joined: Thu Jul 21, 2022 3:00 pm
Contact:

Re: Passsing private data to external dataset xpath

Post by nfulton »

I am attempting to do the same thing. Is there a solution to this issue?
laurentd
Member
Posts: 140
Joined: Wed Mar 13, 2019 2:06 pm

Re: Passsing private data to external dataset xpath

Post by laurentd »

The Variable XPath Repeater app does exactly what you want!
Laurent De Wilde, Solution Architect @ Enfocus
Post Reply