Expand my Community achievements bar.

SOLVED

How to get the counts of records?

Avatar

Level 2

Hi, 

I need to count of records , for example, I have 3 transaction in my database activity after split I am getting total number of records show up on arrow (as normally we see) so now I need to get these counts and either put that number in temp schema or any excel file (for reporting purpose) please let me know, thanks for your support. 

 

GUPTAA

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hello @CSLTGUPTAA ,

 

You Add  javascript code activity and  enrichment activity after the split outbound transitions.

 

Eg.

_Manoj_Kumar_0-1595236378241.png

 

in your javascript activity, create an instance variable and store counts in it.

_Manoj_Kumar_1-1595236438336.png

Make sure to change the count1 to count2 in second javascript activity.

 

Then in the enrichment activity just call this count1 like this.

_Manoj_Kumar_2-1595236504606.png

 

You final output will look like this after the enrichment.

_Manoj_Kumar_3-1595236576033.png

 

 

Note: Count value will remains same for the rows.

 

Let me know if that helps.

 

 

 


     Manoj
     Find me on LinkedIn

View solution in original post

4 Replies

Avatar

Correct answer by
Community Advisor

Hello @CSLTGUPTAA ,

 

You Add  javascript code activity and  enrichment activity after the split outbound transitions.

 

Eg.

_Manoj_Kumar_0-1595236378241.png

 

in your javascript activity, create an instance variable and store counts in it.

_Manoj_Kumar_1-1595236438336.png

Make sure to change the count1 to count2 in second javascript activity.

 

Then in the enrichment activity just call this count1 like this.

_Manoj_Kumar_2-1595236504606.png

 

You final output will look like this after the enrichment.

_Manoj_Kumar_3-1595236576033.png

 

 

Note: Count value will remains same for the rows.

 

Let me know if that helps.

 

 

 


     Manoj
     Find me on LinkedIn

Avatar

Level 2
Hi Manoj, thanks a lot, It worked well. Glad to have a quick solution from you,

Avatar

Level 1

Hello @_Manoj_Kumar_ , 

 

I added the javascript code activity and stored the counts to instance variable as you showed in the second screenshot. 

CT1945_1-1684501906103.png

 

However, when I tried to add the enrichment as your third screenshot, I was unable to call count1. I put [instance/vars/@count1] in the expression, but it showed it's unknown. 

CT1945_2-1684501981019.png

 

Could you please help me with the problem ? 

 

Thank you in advance,

CT