Restricting the amount you can enter on a number field*

Answered

Comments

6 comments

  • Avatar
    Sara Kaplow, Community Manager

    Hi Kenneth,

    I think your workaround is exactly what we'd recommend, but let me poll some of our app builders and see if there's another option. There might be another way with a kind of silly reference data file, but that would require at least some maximum, even if that max was huge (and I think this would be a mess to manage, but it could be another option).

    Anyone else solved this problem? 

    0
    Comment actions Permalink
  • Avatar
    Sara Kaplow, Community Manager

    Verified with an expert app builder (hi Andrew!) that that's how he'd do it. The other thing he suggested was in addition to having the warning screen, to have a hidden required field conditional where if that number is >0, it sets a value and you can proceed, but if it's <0 it doesn't set a value and so you can't complete the App. Just another level of protection to ensure that they do it right. 

    0
    Comment actions Permalink
  • Avatar
    Kenneth Bryan Piamonte

    Hi Sara,

    Wow! I never thought about that kind of setup! I tried it today but I was not able to get the output that I was expecting haha (I hate Mondays). Would you be so kind to provide me an example of setting this up?

    Thank you!

    0
    Comment actions Permalink
  • Avatar
    Sara Kaplow, Community Manager

    Absolutely! What I did was create a new short text field, and made it both hidden and required. I set the condition on that field to only show if the calculation (quantity - approved quantity) is less than 0: 

    That will display the field, but since the user isn't able to add anything to it (because they can't see it), but it's required, it will give you a validation error: 

    It's not the clearest message, but it will stop them from submitting. Then your static text can appear that directs people to change their Approved Quantity. 

    Does that clarify at all? It's a little weird, but effective. 

    1
    Comment actions Permalink
  • Avatar
    Kenneth Bryan Piamonte

    Oh my God! You are amaaaazing!

    I thought you were pertaining to use "field condition" (to hide the field) in tandem with the "required" setting at first. I totally forgot about the "Mobile Visible" checkbox hahaha!

    I was finally able to make it work, and that is all thanks to you, Sara! :)

    (You guys should have a kudos points system in your communities section).

    0
    Comment actions Permalink
  • Avatar
    Sara Kaplow, Community Manager

    It's admittedly a bit of a weird process (it took me a few tries to wrap my brain around it, even though Andrew explained it to me). Glad it's working! 

    1
    Comment actions Permalink

Please sign in to leave a comment.