Condition for Rule Engine if not whole number flag value (Column Combiner)

Hi,

Thank you for support,

I used a ‘Column Combiner’ node and included 9 variables to make one column,
the output displays this column as a string with all values for those 9 variables separated by commas and with quotes for each value
Now, I would like the Rule Engine node to parse this string and ONLY output the value (out of 9) the variable that is not a whole number

Any advice is appreciated, thanks for the consideration,
Cheers!
-SD

Hi @thisgirlsara,

You can use this expression in the String Manipulation node to get your desired output:

regexReplace(
	regexReplace(
		regexReplace($combined string$, ",?\"\\d+\",?", "")
	, "^,|,$", "")
, "\"\"", "\",\"")

:blush:

1 Like

Hi there @thisgirlsara,

Rule Engine node is not for parsing strings. String Manipulation, Column Expressions or Java Snippet can get the job done depending on preferences and knowledge. If you share example data you might get other ideas other than this simple regex which I sure should work :smiley:

Br,
Ivan

2 Likes

Hey,

I am happy you said Column Expressions.
I used this and found this online (https://www.w3resource.com/javascript-exercises/javascript-math-exercise-38.php) with this I was able to place in the variable and test if it was not a whole number

Cheers,
SD

1 Like

Hi @thisgirlsara,

glad it helped!

Br,
Ivan

function number_test(n)
{
var result = (n - Math.floor(n)) !== 0;

if (result)
return 1;
else
return 0;
}

number_test(column(""));

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.