Add 1 to number by double click on field

Tap Forms – Organizer Database App for Mac, iPhone, and iPad Forums Script Talk Add 1 to number by double click on field

Viewing 2 reply threads
  • Author
    Posts
  • December 6, 2023 at 5:35 AM #50215

    John Juhl
    Participant

    Hi guys,

    I would like to make a script that will add 1 (one) to an existing sum in a number field.

    so that by double-clicking the field, it goes from, for instance, 110 to 111

    But how can I do this?

    kr.

    John

    December 7, 2023 at 1:06 AM #50217

    Brendan
    Keymaster

    Hi John,

    There’s no function to trigger a script by double-clicking on a field.

    However, you can have Tap Forms add 1 to another field if the Number field is manually changed by using a script.

    When you call the record.getFieldValue(field_id) function, the field that corresponds to field_id will be monitored for changes. When the value changes in that field, the script will be executed and you can have it increment the value in another field, or return the value right from the script field which could be the monitored field’s last value plus one.

    Thanks,

    Brendan

     

    December 7, 2023 at 10:47 AM #50218

    Daniel Leu
    Participant

    I do something along these lines Brendan mentioned: I use a toggle field to trigger an action on another field. So for you, this could mean that toggling such field would increment your number field.

    Don’t know if this helps, but you can auto-increment number fields when creating a new record.

Viewing 2 reply threads

You must be logged in to reply to this topic.