Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi There,
Need help in looping the URL added to tRestClient.
sample URL:
/api/v3/projects/5582/test-runs/723678/test-logs?page=1&pageSize=1
Need to loop through page 1 to n.
Note - not able to loop via tLoop as it is not allowing as an input to tRestClient
Rest flow is working fine, just need help in looping the URL.
Thanks
Hi
You can add a tJava component between tLoop and tRestClient, eg:
tLoop--iterate--tJava--oncomponentok--tRestClient
On tJava, you can build the URL with current value and assign it to a context variable for used later on tRestClient.
context.URL="/api/v3/projects/5582/test-runs/723678/test-logs?page="+((Integer)globalMap.get("tLoop_1_CURRENT_VALUE"))+"&pageSize=1";
Context.url is a context variable, you need to define a context variable called url in the Context viewer.
Hi
You can add a tJava component between tLoop and tRestClient, eg:
tLoop--iterate--tJava--oncomponentok--tRestClient
On tJava, you can build the URL with current value and assign it to a context variable for used later on tRestClient.
context.URL="/api/v3/projects/5582/test-runs/723678/test-logs?page="+((Integer)globalMap.get("tLoop_1_CURRENT_VALUE"))+"&pageSize=1";
i have passed context.url, but it is not picking in the URL field of trest, throwing error stating url cannot be resolved. i also have a bearer token to pass which i have added to header of trest.
can you please share some tutorial, not sure why they closed talend community and integrated it here its quite difficult o find any exiting questions
Context.url is a context variable, you need to define a context variable called url in the Context viewer.