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: 
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)
28 Replies
Anonymous
Not applicable
Author

@manodwhb but also i am getting an error same as the above mentioned one

0683p000009M9tY.png

manodwhb
Champion II
Champion II

@mukeshmsp96 , please check for the error in code tab? you need to create body context variable.

Anonymous
Not applicable
Author

It's working but not posting any data to the website 

instead its giving the error code :1010 in the tlog row output

manodwhb
Champion II
Champion II

@mukeshmsp96 , which means may the api is might have issue to connect or content not set in the component.

 

 

Anonymous
Not applicable
Author

what "value" should be given in context wit the name "body"

and the output and error are like this


{"name":"{"name":"mukesh"}"}
error code: 1010|403
{"name":"{"name":"john"}"}
error code: 1010|403
{"name":"{"name":"robert"}"}
error code: 1010|403
{"name":"{"name":"abdul"}"}
error code: 1010|403

in the above is passing like

{"name":"{"name":"mukesh"}"}

 

but i wanted to pass like

{"name":"mukesh"}

{"name":"john"}

{"name":"robert"}

{"name":"abdul"}

to the website and this is the format of my website api body

manodwhb
Champion II
Champion II

@mukeshmsp96 ,can you share the trest component body,what are you passing.

 

 

Anonymous
Not applicable
Author

below are my trest and the context data

 

 

 

0683p000009MA1Q.jpg

 

0683p000009MA1V.png

manodwhb
Champion II
Champion II

@mukeshmsp96 , as per your code you were passing {"name":"mukesh"} to rest component,not sure how it was.

 

try to remove pass only name assign to body context and pass it,may your rest api is accepts only the value like name and the rest of this it is generating its own.

 

 

Anonymous
Not applicable
Author

i have tried but also its giving an error 

and first i tring to pass only the single value manually then it showed

like this

400|{"name":["This field is required."]}

i think we have to pass only the value in place of ["this field is required"]

manodwhb
Champion II
Champion II

@mukeshmsp96 , Yes only one value need to pass.