Restricting the amount you can enter on a number field*

Answered

Hi Team,

I would like to ask for some help since I'm running out of ideas on this problem of mine haha!

Can we restrict the value that a user can enter on a field by using the amount that was entered from a previous screen as the 'maximum amount'?

Ex.

1st Screen:
Quantity: 100

2nd Screen:
Quantity: 100 ----------> Mirrored from the 1st screen
Approved Quantity: XXX  -------------> The user should only be able to enter values ranging from 0 to *100, the next user should not be able to exceed what the first user typed on the first screen.

***The amount/number on the first screen varies so I can't set a maximum value.***

Right now my current workaround is that I set a conditional screen that shows a warning message if the calculation doesn't go according to plan (ex. if the value shows a negative number, then this warning screen will show up).

Thanks again for your amazing assistance last time :)

 

0

Comments

6 comments
Date Votes

Please sign in to leave a comment.

  • 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
  • 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
  • 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!

    (Edited )
    0
  • 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
  • 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
  • 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

Didn't find what you were looking for?

New post