Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello
I need some community support with using the tRest---->xmlfield---->FileoutDelimited.
Any help on this would be much appreciated. Screens are below.
Hello
I got the same error with tExtractXMLFields, however, it works if I write the response to a file with tHttpRequest and then use a tFileInputXML to read the file. see
Regards
Shong
Hello
I got the same error with tExtractXMLFields, however, it works if I write the response to a file with tHttpRequest and then use a tFileInputXML to read the file. see
Regards
Shong
Hi Shong,
that worked well thank you very much. Im not explorer how to create a variable and rotate through the date in the URL. For example if i set the job to run through every date from today + 3 days from now. do you have any advice on where to start with this?
kind regards
David
Hello
If i understand your request well, you want to loop a date range and call the API for each date. To achieve it, you need to use a tLoop to do a loop for the API calling, eg:
tLoop--iterate--tJava--oncomponentok--tHttpRequest--oncomponentok--other components.
on tLoop, check 'For' loop type, set From as 0, To as 3, and Step as 1.
on tJava, build a dynamic URL for used on tHttpRequest:
int i=((Integer)globalMap.get("tLoop_1_CURRENT_VALUE"));
java.util.Date currentDate=TalendDate.getCurrentDate();
String stringDate=(TalendDate.formatDate("yyyy/MM/dd",TalendDate.addDate(currentDate, i, "dd"))).replaceAll("/0","/");
//System.out.println(stringDate);
context.URL="https://tatts.com/pagedata/racing/"+stringDate+"/RaceDay.xml";
on tHttpRequest, set the URL with context variable context.URL
Regards
Shong
Thanks again Shong. Proposed solution worked. Originaly i got working with just placing
"https://tatts.com/pagedata/racing/"+TalendDate.getDate("yyyy/M/d")+"/NRFields.xml"
in the URL but it would only get one date.
i will start another post with a different heading as i am now trying to get the URL to change based of a dynamic list which comes from another HTTP XML request.
thanks again, much appreciated.
kind regards
David