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

Announcements
Discover how organizations are unlocking new revenue streams: Watch here
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

how put the body in trestclient and loop the body with multiple values

I have a data that consists of many names

and the body is like

{

"name":"names"

}

these names consists of many values that i am getting from the database

and then post those names into website i am using the flow like

tpostgrsqlinput ---->tmap------>twritejsonField------->trestclient------->tlogrow

in trestclient i am using post method

and i dont know where to write the body data and it should be looping after every data is posted

like after posting one name value ex:mukesh

it should loop and post the next value ex:antony

and so on 

Labels (3)
1 Solution

Accepted Solutions
manodwhb
Champion II
Champion II

@mukeshmsp96 ,

 

not like 

{

\"name\":\"mukesh"\

}

 

correct one is 

{

\"name\":\"mukesh\"

}

View solution in original post

28 Replies
manodwhb
Champion II
Champion II

@mukeshmsp96 use the tFlowToIterate between twritejsonField and trestclient and construct the by using (String)globalMap.get("row2.ABC") from tFlowToIterate .

 

Anonymous
Not applicable
Author

@manodwhb but tflowToiterate cannot be connected to the trestclient how can it be done

can you please be more specific as i am a beginner to talend

manodwhb
Champion II
Champion II

@mukeshmsp96 , you can design below way.

 

0683p000009M9zF.png

Anonymous
Not applicable
Author

how to use the body in post method 

like my body should be in this format

{

"name":"name_of_the_Person"

}

where to use this type of data in post method in trestclient


output1.PNG
manodwhb
Champion II
Champion II

@mukeshmsp96 , find in the below screenshot.

"{\"name\":\""+((String)globalMap.get("row3.newColumn"))+"\"}"

 

0683p000009M9zK.png

Anonymous
Not applicable
Author

its giving an error that type mismatch cannot convert from string to document

error in tflowToIterate and tfixedFlowInput

 

0683p000009M9it.png

manodwhb
Champion II
Champion II

@mukeshmsp96 , check the below way.

 

0683p000009M9ey.png0683p000009M9uH.png

Anonymous
Not applicable
Author

its giving an error 

my data that i need to pass to the body is in the string0683p000009M9zt.png

manodwhb
Champion II
Champion II

@mukeshmsp96 , have defined body filed in conetxt and you need to log the data into tLogrow.