cancel
Showing results for 
Search instead for 
Did you mean: 

Logging data in loops

cc-sean
Deputy Chef I
Deputy Chef I

I'm fairly new to Workato and feel like I'm missing something basic.

In a For-Each loop I sometimes need to log/debug what happened at each step of the loop. When I view the logs it only seems to show the last step in the loop. Is there a way to view the logs for each step in the loop?

Thanks!

1 ACCEPTED SOLUTION

shivakumara
Executive Chef I
Executive Chef I

Hi @cc-sean ,

All Developers go with this pain, but for testing purpose we log the input from the loop.
Here is screenshots 
Image_1 : Adding Value from the {For each loop}  

Note : Make sure that you toggle the "Send to Workato log service" as it is highlighted in Blue color. 

Image_2: Output showing in the Logs { Tools -> Logs}
Here we can check all the values coming from loop.

Hope I solved your issues for time being. I will check is there way to handle it without using logs.

Image_2: logsImage_2: logs
Image_1Image_1

Thanks and regards,
Shiv Avadhani

View solution in original post

4 REPLIES 4

shivakumara
Executive Chef I
Executive Chef I

Hi @cc-sean ,

All Developers go with this pain, but for testing purpose we log the input from the loop.
Here is screenshots 
Image_1 : Adding Value from the {For each loop}  

Note : Make sure that you toggle the "Send to Workato log service" as it is highlighted in Blue color. 

Image_2: Output showing in the Logs { Tools -> Logs}
Here we can check all the values coming from loop.

Hope I solved your issues for time being. I will check is there way to handle it without using logs.

Image_2: logsImage_2: logs
Image_1Image_1

Thanks and regards,
Shiv Avadhani

Thanks that helps!

Be VERY careful with this, as each call to the Logger counts as a Task in your allotment. This can quickly become a very expensive way to debug your code.

Hi @blakesha ,

The recipe above is not an ideal way to handle this, but the question above was related to debugging.
The optimal solution can be: have a variable in the form of a list (batch), which also save the tasks.

Thanks and regards,
Shivakumara Avadhani