I am using a bunch of sets and switches to set scores based on past values. E.g. I want to add a different points to “points” variable depending on age… then I’ll do the same with something else…
Use case = lead scoring for CRM
Question: is there an easier way to achieve this in a code block or something using a switch statement inside of it? That’s how I’d do it if i was using “vanilla JS”
Not sure about the exact usecase but you can probably make a list and then merge(combine - enrich input 1) that to your data. It depends on the data checks though.
From looking at your screenshot I suspect each Set node is indeed just adding or subtracting points? This would easily be doable in a Code node as well and is probably how I’d implement it seeing the number of different options.
Here’s a quick example workflow that adds or subtract points depending on an age value from an incoming item: