You are viewing limited content. For full access, please sign in.

Discussion

Discussion

The easiest way to count the number of occurrences of a value in a multi-value token

posted on March 29, 2016

Let's say that I have a multi-value token called "Names" that have the following values:

  • Bob
  • Jack
  • Bob
  • Lisa
  • Jack
  • Bob
  • Michael

 

I want to find out how many times the name Bob appears inside this token. What's the easiest way? I looked in the functions section of the token editor but didn't see anything relevant. Currently the way I do it is put the token through a For loop with a conditional inside that checks if value equals Bob and then increment a counter, but that seems super complicated for something this simple.

The use case is a web request that returns JSON from a web service. From there, I grab a bunch of names using the Read JSON activity, which generates the Names token. I then need to count a specific name in it.

0 0
You are not allowed to reply in this post.

Another way...

One way of many...

Sign in to reply to this post.