Expand my Community achievements bar.

SOLVED

Display logs of each Javascript activity in workflow show consolidated logs of all the multiple javascripts activities present in the single workflow

Avatar

Level 2

Hi,

 

I am making an API call  to users using querydef inside the JS activity of workflow. Since Querydef can handle 10k records at a time, we split the entire records into 9k each and used multiple javascripts as show below. We created one JS activity and copy pasted the same for the other two. I am using 'logInfo' inside the JS activity to print the users the the API call has been made.

 

The issue is, when right click on The JS activity and do display logs, I see the entire consolidated logs of the 3 JavaScript activities inside each java script activity . For example: in the below case, I see 27k user data inside each JavaScript activity when I do 'Display logs' instead of the 9k API call each JS activity has performed individually. Is it an expected behavior? How can I be sure that Multiple API calls are not made to the same user?  Please help

 

BhaskarJC_1-1715881133841.png

 

 

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hello @BhaskarJC 

 

Display the target only work with activites which generates a temporary schema on execution. JavaScript activity does not create a temp schema and the temp schema from previous activity is used and that is why you see all records in the display target.


     Manoj
     Find me on LinkedIn

View solution in original post

3 Replies

Avatar

Level 4

I've noticed that in workflows where I copy and paste code activities, they often seem to retain the logs of the copied activity and I end up needing to check the timestamps to see whats actually happening. 

I often like to wrap easy to spot headers around my code (with the name of the activity at the bottom as the logs display newest to oldest, so it'll be at the top).

logInfo('/////////////////////')

-CODE TO PRINT USERS-
logInfo('NAME OF MY ACTIVITY')
logInfo(new Date())
logInfo('////////////')

 

You could even drop the code to print out the specific users and it'll let you confirm 100% WHAT is being executed there.

I also wrote a quick example up on how I've overcome the 10k queryDef limit by ordering the records in my query and putting everything within a loop HERE

Avatar

Correct answer by
Community Advisor

Hello @BhaskarJC 

 

Display the target only work with activites which generates a temporary schema on execution. JavaScript activity does not create a temp schema and the temp schema from previous activity is used and that is why you see all records in the display target.


     Manoj
     Find me on LinkedIn

Avatar

Administrator

Hi @BhaskarJC,

Were you able to resolve this query with the help of the given solutions or do you still need more help here? Do let us know. In case the given solutions were helpful, then kindly choose the one that helped you the most as the 'Correct Reply'.
Thanks!



Sukrity Wadhwa