Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
joefrancois
Contributor III
Contributor III

I need help creating a job taking in multiple XML and iterating the through row and adding to the output row

Hello,

 

I need to take multiple XML input (using REST) in write them to a DB table. The tricky bit is that, for each row, I will need to go get additional data to complete the row. Let me explain.

 

When do my first REST query, I will get a list of orders with  (OrderID, First and last Name, Address, Total amount). Than for each order, I have to make another REST call  using the OrderID to get the items ordered, it will contain (OrderID, Item, quantity, price, etc..). I will need to combine the order row with item ordered  row to import them in my DB table.  If the orders contain two or more type of product, than I would need an order line for each product.  Not sure how to go about doing this, Should I write multiple file and than read the file back in and how do I go through the orderID to get all the items ordered.

 

Any help would be much appreciated. 

 

Thank you

Labels (5)
1 Solution

Accepted Solutions
vapukov
Master II
Master II

depending from how big response for first REST request, You could:
- receive result

- parse it with tExtractXMLFields

- store result to Hash (memory) or csv
- read from Hash/csv

- using tFlowToIterate iterate over saved result one by one for request new data
- join new data with saved using tMap

 

View solution in original post

4 Replies
vapukov
Master II
Master II

depending from how big response for first REST request, You could:
- receive result

- parse it with tExtractXMLFields

- store result to Hash (memory) or csv
- read from Hash/csv

- using tFlowToIterate iterate over saved result one by one for request new data
- join new data with saved using tMap

 

joefrancois
Contributor III
Contributor III
Author

Thank you very much for your answer. Now I have two questions.

 

1. When iterating to Hash/CSV, I assume the rows will be appended and the file not overwriten?

 

2. How do I use the value of the first column in the REST call I am making. See the pictures for more details.

0683p000009Lwrl.pngHere is my CSV map, what I am interested in is the OrderID field

 

 

0683p000009Lx7W.pngI am trying to iterate on OrderID and set the valuable

 

0683p000009LxD4.pngNow I am trying to use the variable to make a REST call

vapukov
Master II
Master II

1) sure - You could append in both cases 

2) what the problem with this? it must work if all other defined correct

joefrancois
Contributor III
Contributor III
Author

You are right, don't know what happen but this time it worked. Thank you