Increment variable in Forms

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?

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 knowledge article.

Thanks,
Rueben

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 :laughing: as you can only set it once, but never change inside forms/flows

1 Like

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. :sweat_smile: :clap:

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

Cheers,
Rueben