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

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Only one row is is sent through tRestResponse

For this flow here https://community.talend.com/t5/Design-and-Development/No-response-is-coming-from-tRestResponse/m-p/...

I'm not able to get all the 100 rows that are coming from the database.

can you please help.

thanks!

Labels (5)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Your XML structure is not configured to loop. You need a looping element in there. You simply have two elements sitting inside the Root element. That won't work. 

 

You are not joining your input row to your lookup row either. This will mean you get the same result no matter what is sent to the service. That can't be correct, can it?

 

Add a looping element to your output XML and test it with a tLogRow. If you follow the guide after doing that, you will see 100 loops in a single XML file

View solution in original post

10 Replies
Anonymous
Not applicable
Author

Can anyone help with this issue?

 

Thank you!

Anonymous
Not applicable
Author

A REST service works by receiving a call and returning a response for that call. You will only get 1 response for 1 call. What exactly are you looking to achieve here? If you are hoping to send back 100 messages, that won't be possible. If you are wanting to send back an XML file with  100 looping sections in it, that is possible.

Anonymous
Not applicable
Author

Right, I'm trying to get a 100 rows from the database and send it back in one response, I tried tXMLMap but it didn't work.

Anonymous
Not applicable
Author

Take a look at this page: https://help.talend.com/reader/ixBASPZJ7IvqUQVupZwWbg/EFuE5Nul595D24TRwbFnbw

 

Also, remove your service components and just try it as a job first. Output to a tLogRow. That makes it easy to see when you've got it right. Then attach the service components again.

Anonymous
Not applicable
Author

I reviewed that, my case is different, I have connected my Teradata connection through a lookup to tXMLMap I would like to lookup a 100-1000 rows and map it in tXMLMap then send it to the response, but the problem is that I'm getting only one row back:

 

{
    "root": {
    "accountId": 999999999,
    "rank": 1
    }
}

 

is the problem with the lookup? or the mapping?

 

0683p000009M03K.png0683p000009M05J.png0683p000009M05O.png0683p000009M05T.png

 

Anonymous
Not applicable
Author

Your XML structure is not configured to loop. You need a looping element in there. You simply have two elements sitting inside the Root element. That won't work. 

 

You are not joining your input row to your lookup row either. This will mean you get the same result no matter what is sent to the service. That can't be correct, can it?

 

Add a looping element to your output XML and test it with a tLogRow. If you follow the guide after doing that, you will see 100 loops in a single XML file

Anonymous
Not applicable
Author

Great, I just added the looping element and it worked. My initial understanding is that the root loop can make it work without me adding a looping element. Make sense?

 

I'm not joining my input row to the lookup because I wanted to get the looping part done first then I'll connect it together.

 

Thank you for your help, my final question would be why I'm getting numbers in the JSON istead of String values, although I explicitly converted the rank using a toString() method? 

 

 

Anonymous
Not applicable
Author

I'm not sure about your data types to be honest. It is hard to figure out what is going wrong without having access (so I can see all inputs and outputs, etc). However, have you tried assigning your value like below (assuming your inputs are ints or other number types)....

 

row.columnValue + ""

That might solve your issue. 

Anonymous
Not applicable
Author

This solved the problem, thanks!

 

Now I got to the linking part, I've been googling around, and I couldn't find away to link a variable to a lookup table, I'm trying to link the variables coming from the service request:

 

Here is my query 

"select acct_id, rank() over (order by acct_id desc)  as myrank from xxxxxxxxxxxxxxxxxxx qualify myrank between " + Integer.parseInt(request.key) + " and " + request.customfield_10003

 

the error is "request cannot be resolved to a variable", is it allowed to to be used like this?

 

Your help is appreciated!

0683p000009Lzm5.png