I have a form with an input field for number. When I enter any other number besides zero, it shows up when I bring up the form for editing; but when I enter zero, it shows up as a blank field. As this field is supposed to be mandatory, user has to keep putting zero in there before they are able to save every time which is bit of a nuisance.
Is there any way to get a ZERO entered into the form to be saved and shown in an edit form?
I have seen multiple posts about this but it is not clear on how to get it done. Appreciate any help!
I also have another field which is not mandatory and I need to know whether user filled in zero or left blank.
Hi SP99,Change the Data Type of attribute to Text then I will show 0 as well.And restrict the User to enter only numbers using regex.RegardsKrishnanand Pathak
Since the column is a number, outsystems shows a warning when I set the input type to text but let's say that's fine.
How do i restrict user to only enter numbers using regex. Pointer appreciated!
To remove warning the create a variable of Type text.Then while saving the assign source column with the Text variable by converting the TextToInteger.While update assign the Text variable at OnAfterFetch from aggregate value.Try the below componenthttps://www.outsystems.com/forge/component-overview/14672/restrict-characters
Hi SP99Sharing the oml in which I perform the same thing as mentioned above.There are two screens ContactDetailDetail, ContactDetails.At ContactDetailDetail we are taking input as text(That allow only number) and storing in db as numberYou can check the demo to see how it will work through below link.https://personal-qmzjggmd.outsystemscloud.com/OnlyChar/ContactDetails
RegardsKrishnanand Pathak
Really appreciate your help. One more thing. If a person does not enter anything in the Contact field, the field shows 0 when you view it. How can we show it to be nothing if nothing is entered, and zero if zero is entered?
As you mentioned earlier, This field is Mandatory .Then Just set the Mandatory to True as shown below. So, that user has provide contact at least 0 or anything.
Hi Krishnanand,
I do have another number field that is not mandatory and I want to that field to show 0 if person enters 0, and blank if nothing is entered in that field. This form needs to be editable by different people and they need to see the value entered in the field.
Currently the input field shows up blank if someone enters zero.
Appreciate your input.
Thank you
To do this you need to change the Db table attribute data type to text.
So, that it can store empty as well.
from UI side restrict the user to enter only number.
did you get the solution if not please check the following thread
https://www.outsystems.com/forums/discussion/33763/outsystems-ui-input-widget-doesnt-display-zero-value/
if yes please mark it solved.