# Increment variable in Forms

**URL:** <https://community.auth0.com/t/increment-variable-in-forms/183721>\
**Category:** Get Help\
**Tags:** configuration, application\
**Created:** [March 11, 2025, 5:47pm UTC](https://community.auth0.com/t/increment-variable-in-forms/183721 "2025-03-11T17:47:32Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![phi1ipp](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/phi1ipp/32/40616_2.png) [@phi1ipp](https://community.auth0.com/u/phi1ipp)\
**Post date:** [March 11, 2025, 5:47pm UTC](https://community.auth0.com/t/increment-variable-in-forms/183721/1 "2025-03-11T17:47:32Z")

</div>

Is it possible to increment a variable set in one place (flow) on forms? I’d like to capture number of attempts to provide an incorrect answer to a custom OTP challenge by incrementing it before my validation attempt?

---

<div class="post-metadata">

**Author:** ![rueben.tiow](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/rueben.tiow/32/11646_2.png) [@rueben.tiow](https://community.auth0.com/u/rueben.tiow)\
**Post date:** [March 11, 2025, 7:21pm UTC](https://community.auth0.com/t/increment-variable-in-forms/183721/3 "2025-03-11T19:21:42Z")

</div>

Hi @phi1ipp,

Thanks for your question.

You can send a variable from Actions to Forms to determine the number of user attempts, and save it under the user\_metadata. Then, you can provide an incorrect answer to a custom OTP challenge with that information. Once the Flow on Forms is complete, you can increment the variable in an action script received from Forms.

For more information, please refer to our [How to Send Variable Values from Actions to Forms and Back to Actions](https://community.auth0.com/t/how-to-send-variable-values-from-actions-to-forms-and-back-to-actions/135720) knowledge article.

Thanks,  
Rueben

---

<div class="post-metadata">

**Author:** ![phi1ipp](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/phi1ipp/32/40616_2.png) [@phi1ipp](https://community.auth0.com/u/phi1ipp)\
**Post date:** [March 11, 2025, 7:52pm UTC](https://community.auth0.com/t/increment-variable-in-forms/183721/4 "2025-03-11T19:52:40Z")

</div>

Hi @rueben.tiow ,

thank you for your answer. I’m not sure I can use your suggestion. The idea is to limit a number of attempts within the same form execution, as I can’t re-render the same form after coming back to action.

From what I see, this functionality should’ve been called `constants` and not `variables` 😆 as you can only set it once, but never change inside forms/flows

---

<div class="post-metadata">

**Author:** ![rueben.tiow](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/rueben.tiow/32/11646_2.png) [@rueben.tiow](https://community.auth0.com/u/rueben.tiow)\
**Post date:** [March 11, 2025, 10:56pm UTC](https://community.auth0.com/t/increment-variable-in-forms/183721/5 "2025-03-11T22:56:54Z")

</div>

Hi @phi1ipp,

Ah, yes, then your understanding is correct. You won’t be able to limit the number of attempts within the same Form execution.

You are correct that it should have been named `constants` instead of `variables` since they can only be set once and cannot be changed within Forms/Flows. 😅👏

In this situation, it might be worth submitting a #Product Feedback request asking for support for your use case.

Cheers,  
Rueben

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [March 25, 2025, 10:57pm UTC](https://community.auth0.com/t/increment-variable-in-forms/183721/6 "2025-03-25T22:57:28Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
