Incremental button for an input with a custom state

Hello all,

I made an form with an input (number/decimal format). Thanks to 2 incremental buttons, the user is able to increase(+1) or decrease (-1) the number in the input field.

I made it thanks to an ‘incrementalState’ custom state linked to the page, and used in buttons and the field. Initial content in the input is parametered as ‘index’s incrementalState’.

My problem is this :
It works UNTIL I manually enter or modify the number in the input, and then click again on the incremental buttons, nothing happens anymore.

Can somebody see a solution please ?

Hi there, @ravn… here is one way to do what you described. You could put the input in a group and set the group’s type of content to number and its data source to index's incrementalState. Then, set the input’s initial content to the Parent group's number. Finally, add a workflow so that when the input’s value is changed, the entered value is set as the custom state’s value, and have the second (final) step in the workflow reset the data on the group.

Hope this helps.

Best…
Mike

1 Like

Thank you for your precious help Mike !

Everything seems crystal clear to me except this part “add a workflow so that when the input’s value is changed, the entered value is set as the custom state’s value” to be honest I don’t find the good way to make it.

(I tried to make it but current functional behaviour is : when I manually modify the value and then click on an increment button the incremental buttons work again but the previous number of clicks on the buttons isn’t reset even if I put the “Reset group” step when Input’s value isnt This Group’s Number).

There is a workflow event that is literally called An input’s value is changed, and I was talking about using that event to detect the change to the input’s value and set the custom state to that value. Want to give that workflow a shot?

1 Like

I didn’t see this workflow type ^^’

Thank you for your help, I did as you advised and the functional behaviour is now perfect !

1 Like