Math and Function Node

In our use case, we allow end users to create their own formula for transposing readings coming in from a device into the unit of measure they want to see. For instance, our device can measure milliamps 0 - 24. This device can be set up to monitor a tank of water with a pump attached. The user can create a formula to transpose the reading of say 7 milliamps from the device, into feet of water that is in the tank.

Why can’t the workflow evaluate a string formula? The Math node can’t do it, and the Function node, which is supposed to support JavaScript can’t even run the eval(string) function.

How do I get a string (“5 * 2.1625 - 8.65”) to evaluate in a workflow?

Hi @Jonathan_Betke,

The platform’s current functionality does not support evaluating a string formula. I will make a feature request with our engineers, and follow up with any ideas we may come up with to solve this problem.



One crazy idea I just had. You might be able to use something like this:

It’s a library that allows you to create a JSON representation of logic. Being that’s its JSON, you could evaluate it within the workflow engine. Overall, depending on complex the customers’ logic is, you may be able to come up with your own standard. But, this may be a lot of work to solve a simple problem.

Anyway, just letting you know the idea I had. Now that we have the feature in the system we may come up with the right way of doing it in the future.