cancel
Showing results for 
Search instead for 
Did you mean: 

Why doesn't this file datasource loop terminate?

SOLVED
Occasional Contributor

Why doesn't this file datasource loop terminate?

This file datasource uses a text file that has 10 lines in it, each line is a phone number like 9495550000

The data loop as it is doesn't terminate.  What could be going wrong?

 

The screen shot shows the test case, as well as the data log for the data source with only the first two numbers.

 

ready-api-file-datasource.png

1 ACCEPTED SOLUTION

Accepted Solutions
Community Hero

Re: Why doesn't this file datasource loop terminate?

HI,

 

I've never seen a loop used that way - what's the purpose behind it?

 

When you specify a datasource loop - you have to specify the target step and the datasource step.  Currently your target step is the same as your datasource step - typically the Target Step value is some sort of Request (REST/SOAP etc.) that uses the data from the datasource in some way -  so you point the loop's target step back to the request that uses the data - not the datasource step itself.

 

If you stuck a REST request in between the datasource and the loop steps and specified the target step in the loop config as the REST request - this should execute as many times as the number of lines of data in your datasource file.

 

Hope this helps,

 

Cheers,

 

richie

if this helped answer the post, could you please mark it as 'solved'? Also if you consider whether the title of your post is relevant? Perhaps if the post is solved, it might make sense to update the Subject header field of the post to something more descriptive? This will help people when searching for problems. Ta

View solution in original post

2 REPLIES 2
Community Hero

Re: Why doesn't this file datasource loop terminate?

HI,

 

I've never seen a loop used that way - what's the purpose behind it?

 

When you specify a datasource loop - you have to specify the target step and the datasource step.  Currently your target step is the same as your datasource step - typically the Target Step value is some sort of Request (REST/SOAP etc.) that uses the data from the datasource in some way -  so you point the loop's target step back to the request that uses the data - not the datasource step itself.

 

If you stuck a REST request in between the datasource and the loop steps and specified the target step in the loop config as the REST request - this should execute as many times as the number of lines of data in your datasource file.

 

Hope this helps,

 

Cheers,

 

richie

if this helped answer the post, could you please mark it as 'solved'? Also if you consider whether the title of your post is relevant? Perhaps if the post is solved, it might make sense to update the Subject header field of the post to something more descriptive? This will help people when searching for problems. Ta

View solution in original post

Occasional Contributor

Re: Why doesn't this file datasource loop terminate?

Yay!  Thanks richie.

 

In my case (not shown in my question) there were several steps between the file data source and the REST call and the loop.  For a data source loop step in general, set DataSource Step to the data source step (fairly obvious), and the Target Step to the step after the data source step (not so obvious).  Thanks!