Share feedback, ideas and get community help

Updated 9 months ago

Variables Comparison

At a glance

The community member has 7 variables used for lead scoring and needs to determine which variable has the highest score. A community member suggests using a Set variable block with the scores and then using the reduce() method to find the maximum value.

I have 7 variables used for lead scoring. At the end of the flow, I meed to determine which variable has highest score and declare the result. Whats the best way to do this?
B
P
2 comments
You could add a Set variable block with that content:

Plain Text
[{{Score 1}}, {{Score 2}}, {{Score 3}}].reduce((max, curr) => {
  if(curr > max) return curr
  return max
}, 0)
Awe awesome. Thnk you.
Add a reply
Sign up and join the conversation on Discord