App Connect Data Formatter Support Product Page
  Solved 
 Incriments
 Reported  24 Jun 2017  21:35:06 
  1 
     has   this problem  
  24 Jun 2017  21:35:06 Brad Lawryk posted: 
 I need to when a form is submitted increase a number value by 1 or decrease it by 1 depending on the form.When I try and use the operation and +1 it just adds a 1 to the number instead of updating with a new number.
For example:
If the value of the field in the db is 13 and I need to increase it by one I create a hidden field with the current value of the field and use the formatter to do an operation with +1 that gets updated in the recordset.
However the result is that it changes the current value in the recordset to 131. And if I submit the form again it changes it to 1311 and so on.
I need it to change 14. I've tried everything I can think of.
Replies
 Replied 25 Jun 2017  06:39:25 
   25 Jun 2017  06:39:25 Teodor Kuduschiev replied: 
  Hi Brad, 
It seems you are trying to increment string values, and these operations (+ and -) work only with numeric values. You just need to apply the toNumber filter first and then add the operation, for example:
someValue.toNumber() + 1
  It seems you are trying to increment string values, and these operations (+ and -) work only with numeric values. You just need to apply the toNumber filter first and then add the operation, for example:
someValue.toNumber() + 1
 Replied 25 Jun 2017  08:45:33 
   25 Jun 2017  08:45:33 Brad Lawryk replied: 
  I'll try that. Although my data is stored in an int field already? 
   Replied 25 Jun 2017  10:56:18 
   25 Jun 2017  10:56:18 Brad Lawryk replied: 
  toNumber worked very well. Thanks! 
  
