Xpath-Node: How to import a list of Xpath-Queries via Flow Variables from a csv-file?

Hello,

I query a xml-file with the xpath-node.

It is working fine, but I would like to import a list of Xpath-queries from a csv-file into the xpath-node and not add them manually one-by-one by clicking „Add xpath“.

I guess, that „Flow variables“ are the solution to my problem, but I have no clue how this works exactly.

CSV-Reader? -> Table Column to variable? -> What are the equivalent flow variables in the xpath-node?

CSV-example

Column-name xpath-query type
INN-Name /dns:drug/dns:name String(SingleCell)
IUPAC-Name /dns:drug/dns:iupac String(SingleCell)
... ... ...

  Thank you for your help!

Hi, 

you would need to do the following:

CSV Reader

Table row to variable loop start

XPATH

Loop End Column Append

In the XPath node, go to the configuration panel and once click on Add Xpath, you can just hit okay than no need to enter anything. Than there are three new Flow Variables. newColumn0, xpath0 and returnType0. newColumn0 is your column name and xpath0 is your xpath query flow variable. 

Best, Iris

1 Like

Thanks for your help!

It is working now with slight changes, I needed to solve my problem the 'returnType0' and 'MultiTagOption0'

Structure of my csv-file

newColumn0

xpath0

returnType0

MultiTagOption0

name

/dns:drug/dns:name

String

SingleCell

drugbank-id

/dns:drug/dns:drugbank-id

String

MultipleColumns

... ... ... ...

 

1 Like