Skip to main content
Announcements
Accelerate Your Success: Fuel your data and AI journey with the right services, delivered by our experts. Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
bradsheridan
Contributor III
Contributor III

Iterate on tRestClient

Morning Community...I hope this is an easy one 0683p000009MACn.png

 

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!

Labels (5)
1 Solution

Accepted Solutions
vapukov
Master II
Master II

you need change OnComponentOk connection to Iterate on first picture

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

 

0683p000009M1v1.png

View solution in original post

8 Replies
vapukov
Master II
Master II

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

bradsheridan
Contributor III
Contributor III
Author

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

 

0683p000009M1uX.png0683p000009M1uc.png0683p000009M1tB.png0683p000009M1uh.png0683p000009M1um.png0683p000009M1u0.png0683p000009M1uT.png0683p000009M1hF.png

vapukov
Master II
Master II

you need change OnComponentOk connection to Iterate on first picture

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

 

0683p000009M1v1.png

bradsheridan
Contributor III
Contributor III
Author

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!!!

vapukov
Master II
Master II


@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)

bradsheridan
Contributor III
Contributor III
Author

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

 

0683p000009M1ps.png

vapukov
Master II
Master II

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

bradsheridan
Contributor III
Contributor III
Author

Vapukov...sometimes it's the attention to details that makes the difference 0683p000009MACn.png

 

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!!