I have a workflow for a service request in which I do a calculation at one level and I have to do a compare later. But the Compare is not retuning correct values.
First expression - Multiplication of 2 values and output is a decimal number
Second - Setting 5000 as a value
Condition Operator - I compare output of first with second. If value is greater then return true else false.
My output of first is 37000
The Boolean operator should return true here but its returning false.
Please advise what am I doing wrong.
Page 1 / 1
Have you tested whether the workflow itself works correctly despite the Test Results? I had a situation where the Test Results returned different values than what actually happened when the workflow was executed.
I tested it on my end, and I’m seeing exactly the same behavior - when I set E2 to 37000 and E3 to 2000, the test returns true. But when I set E3 to 5000, it returns false.
Thank you for your reply.
My remaining workflow works perfectly fine till before this. But since it gives the wrong output the rest of the workflow goes in a different direction.
Also based on your testing it got me thinking and I think the issue is that the operator is not taking the full value into consideration.
As you mentioned that when you kept the value as 2000 it returned true. I kept the value as 3700 and it returend true but as soon as I changed it to 3701 it returned false.
and these are manually provided values so it should have given the correct output. But for some reason its not doing it.
Now even I am not sure what to do next.
Indeed, I ran a few more tests and it turns out the tester simply compares the digits one by one from left to right, without considering whether it’s the tenths, hundredths, etc. As a result, it might compare the decimal part of a shorter number to the thousandths of a longer one.
I am doing some testing here and seems if I divide both numbers by 1000 and then compare I am getting correct results. I will keep it like this for few days and see if it works.
Hi folks.
Hope you’re doing great.
I think this may be a kind of bug on the test module.
When the values are compared though the workflow (I mean, being run), numeric values are indeed considered as the data type.
However, in the test expression module, the values at first seem to be treated as text, and that may explain the test results.
I consider this to be a bug, so, I suggest to submit a support case with all this explanations and demonstrations given here so Freshworks could address it properly.
Best,
Hi folks.
Hope you’re doing great.
I think this may be a kind of bug on the test module.
When the values are compared though the workflow (I mean, being run), numeric values are indeed considered as the data type.
However, in the test expression module, the values at first seem to be treated as text, and that may explain the test results.
I consider this to be a bug, so, I suggest to submit a support case with all this explanations and demonstrations given here so Freshworks could address it properly.
Best,
You're right - it seems the tester doesn't actually validate the data type from the Expression, whereas the workflow does. Just like in Excel, multiplying the result of the Expression by 1 is enough to force it to be treated as a number.
Hi folks.
Hope you’re doing great.
I think this may be a kind of bug on the test module.
When the values are compared though the workflow (I mean, being run), numeric values are indeed considered as the data type.
However, in the test expression module, the values at first seem to be treated as text, and that may explain the test results.
I consider this to be a bug, so, I suggest to submit a support case with all this explanations and demonstrations given here so Freshworks could address it properly.
Best,
You're right - it seems the tester doesn't actually validate the data type from the Expression, whereas the workflow does. Just like in Excel, multiplying the result of the Expression by 1 is enough to force it to be treated as a number.
That’s quite interesting and indeed confirms is a bug.
The documentation states that text/string should be enclosed in single quotes; however, it seems it is not completely validating this.
Thanks for sharing this tip for the tests.
Best,
Thank you so much everyone for your feedback. I checked the execution logs and even there it was giving wrong output.
Although I see one variable was “Number” and other was “Decimal” not sure if that would cause the failure. I have changed both variables now to same data type as “Decimal” and waiting for a fresh request from user.