Iterate on tRestClient

Six Stars

Iterate on tRestClient

Morning Community...I hope this is an easy one Smiley Happy

 

I have this flow:

tRestClient ->tExtractJSONFields -> tFlowtoIterate -> tRestClient2 -> tExtractJSONFields -> tLogRow

 

I'm trying to take a list of values from the first tRestClient and pass them one-by-one to the second tRestClient.  But what's happening is that only the last value is being passed.  How can I loop through all values from the first tRestClient?

 

Thanks!


Accepted Solutions
Thirteen Stars

Re: Iterate on tRestClient

you need change OnComponentOk connection to Iterate on first picture

as variant tFloToIterate -> Iterate -> tJavaFlex -> OnComponentOk -> tRestClient

 

Screen Shot 2019-01-12 at 5.03.14 PM.png

-----------
Thirteen Stars

Re: Iterate on tRestClient

check - what settings you define for tRedshiftOutput

for example if it truncate (empty) table or drop and create, result would be exactly as described, only last iteration will be saved

-----------

All Replies
Thirteen Stars

Re: Iterate on tRestClient

Hi

 

your steps sequence is correct, it means - something wrong in settings or job design

you need to share all design, because it very hard to guess - what  wrong, but it could be something small issue

-----------
Six Stars

Re: Iterate on tRestClient

Hi Vapukov and thanks for helping out!!  I'll do my best...here goes...

 

API_1.pngAPI_2.pngAPI_3.pngAPI_4.pngAPI_5.pngAPI_6.pngAPI_7.pngAPI_8.png

Thirteen Stars

Re: Iterate on tRestClient

you need change OnComponentOk connection to Iterate on first picture

as variant tFloToIterate -> Iterate -> tJavaFlex -> OnComponentOk -> tRestClient

 

Screen Shot 2019-01-12 at 5.03.14 PM.png

-----------
Six Stars

Re: Iterate on tRestClient

Vapukov...awesome!  that worked!!! (I think...)

 

Question...so the tJava component is kind of acting like a dummy step simply to get the Iterate functionality?

 

I say "I think" because in my tLogRow, I can see 40 rows for ticket #1 but when I look in the source system, there appear to only be 31 rows.  Then for ticket #2 (the second iteration), I get 20 rows in my tLogRow but there are 35 in source.

 

It's pretty late here and I'm fried mentally, so I'll check first thing in the morning and update you (and the Community).

 

Bottom line...you were a HUGE help!!  Thanks!!!

Highlighted
Thirteen Stars

Re: Iterate on tRestClient


@bradsheridan wrote:

Vapukov...awesome!  that worked!!! (I think...)

 

Question...so the tJava component is kind of acting like a dummy step simply to get the Iterate functionality?

 


yes, it just a dummy (or you can use it for any other iteration operation)

-----------
Six Stars

Re: Iterate on tRestClient

Morning Vapukov - things are definitely working better.  I limited my input set of data to 3 'tickets', each having a varying number of 'revisions'.  The resulting tLogRow correctly outputs the data.  However, when I remove the tLogRow and try to output the data to a table in Redshift, I'm back to getting only the last ticket in the input data.  I tried throwing a tJavaFlex right before the tRedshiftOutput (name 'tfs_boardworkitems in my screenshot below) but that didn't work either.

 

thoughts?

 

Thanks

 

TFS_10.png

Thirteen Stars

Re: Iterate on tRestClient

check - what settings you define for tRedshiftOutput

for example if it truncate (empty) table or drop and create, result would be exactly as described, only last iteration will be saved

-----------
Six Stars

Re: Iterate on tRestClient

Vapukov...sometimes it's the attention to details that makes the difference Smiley Happy

 

I had the Redshift component set to "drop and recreate table if it exists".  Changing that to none, leaving the action to Insert, and adding a prejob to truncate the table each run did the trick!!  

 

Thanks again for all your help!!

Tutorial

Introduction to Talend Open Studio for Data Integration.

Definitive Guide to Data Integration

Practical steps to developing your data integration strategy.

Definitive Guide to Data Quality

Create systems and workflow to manage clean data ingestion and data transformation.