Mark7294305
Posts: 0
Joined: Fri Dec 26, 2014 2:10 am

How to have a value increase or decrease by the value of 1

I have created a database with several columns. Lets say column B have the current value of 5. I want Column C to be the value of Column B + 1 (this is 6) and column D to be Column B – 1 (that is 4).
What JS code do I need to type to allow this to work?

Thanks

Mark

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

How to have a value increase or decrease by the value of 1

Hi Mark,

It very depends on use case you need for your app:

  1. If you want to do it on item create - you need:
    1.1. Link input value to B, C and D request parameters.
    1.2. On C link click on JS and populate it with following JS code:

    pre

    return parseInt(value) + 1;

    /pre

    1.3. On D link click on JS and populate it with following JS code:

    pre

    return parseInt(value) - 1;

    /pre

    Regards.

Return to “Issues”