Jump to content

Maths formula based on capture answers


Recommended Posts

Hi all, 

I am trying to get a maths formula to work which will then be put in an update on the request, any help will be appreciated.

This will be based on numbers that are entered by an analyst into the capture fields on a task. The phrasing of it seems to run normally when I substitute the formula with straight numbers e.g.:

&[((22+33)/983)*(113*1.2).toFixed(2)] - All working

When I try the same thing with the capture answers I get NaN (not a number) as a response:


The fields seem to populate and I have nodes, rescanning both request details and PCF answers, before I have added the formula just in case.

The values I have entered into the task appear correctly when displaying as custom fields in the job info.


Link to comment
Share on other sites


  • You are using the answers which are always characters/strings. Try and convert them before applying math formulas to them. Try using: parseInt()
  • If you are to use the custom fields values (instead of answers) please be aware that custom A and custom B are not numeric fields.
Link to comment
Share on other sites

Hi @Victor, thanks for the reply. 

I've tried to use the custom fields 26 - 28 as they specified (INTEGER). This returns me a result of '0' which is at least a number so progress! As below:


I'm not sure where the parseInt() would fit into this expression - I'm a layman to this but we managed to get similar things working when the answers were taken directly from the real PCF field.

Link to comment
Share on other sites

Thank you!

So the answers are input into the capture fields of the task, they relate to 3D printing. Most have default answers but the volumes will change per job.

So the formula is  ((Material volume + Support material volume) /983) * Material cost *1.2) 


And here as the analyst sees it:


Link to comment
Share on other sites

@LawesD try one of these:





Link to comment
Share on other sites

I tip my hat to you. The first one worked with one more set of brackets to segregate the .toFixed 2 bit. 

So the *1.00 seems to calm the value references back into being a proper number? However it worked thank you for all your help. 


Image result for westworld reaction gif smile

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...