937
Views
12
Comments
Solved
When adding 0 as a value to form, it's showing empty field
Question

Hi all,

I was working on an reactive application in Outsystems 11 and observed that when I add 0 to a input field it saves the value. It shows correctly in a table record widget like in following pic.


But when i want to show it on form widget it makes that input field empty. 

As I provide 0 as a value not for making it a NULL value, Isn't it a wrong approach by outsystems?

2020-07-08 17-58-02
Suprio Roy
Solution

Divyanshu Pathak wrote:

Suprio Roy wrote:

Hi ,

Are you passing the value of the input field as 0 or u r just keeping it blank ? If blank , then it should raise an error as mandatory field is left blank... otherwise if u try to save with the value 0 , then it will display 0 in the table record.



Hi Suprio,

As mentioned above, I passed the value 0. It shows 0 value in table records but doesn't show any value in input field.

Regards

Divyanshu



Hi Divyanshu,

It's a kind of drawback as 0 is considered as NULL. Please go through this thread for better clarification.


https://www.outsystems.com/forums/discussion/42152/null-is-not-0-os-drawback/ 

2020-06-08 06-49-12
Rajat Pal

Divyanshu Pathak wrote:

Hi all,

I was working on an reactive application in Outsystems 11 and observed that when I add 0 to a input field it saves the value. It shows correctly in a table record widget like in following pic.


But when i want to show it on form widget it makes that input field empty. 

Why is it so?

Hi Divyanshu,

Good question.I have also observed that it didn't show  for zero value.

According to me, May be It considering  zero as a null value and displaying nothing for zero

Thanks,

Rajat


2023-01-16 11-11-38
Claudio Freire

Hi Outsystems specialists! 

I'm a beginner (2 weeks) and I'm doing the same "booking" Exercises.

I got the same behavior as Divyanshu.

What is the workaround to fix this issue?

What do you think implementing a "Action Screen Preparation" to valid if the value passed is "Null" and assign a "0" instead?

Perhaps the solution is more simple than that... :-)

Can you please advice me the best approach for it...

Thank you 


UserImage.jpg
Govardhan Reddy

Divyanshu Pathak wrote:

Hi all,

I was working on an reactive application in Outsystems 11 and observed that when I add 0 to a input field it saves the value. It shows correctly in a table record widget like in following pic.


But when i want to show it on form widget it makes that input field empty. 

Why is it so?

Hi Divyanshu,

Good question.I have also observed that it didn't show  for zero value.

Thanks,

Govardhan


2026-02-26 06-29-24
Rahul
 
MVP

Hi Divyanshu,

Consider  zero as a null value and displaying nothing for zero.

same like if null text "" dosent show anything.


Regards

Rahul Sahu

2020-06-08 06-48-23
Divyanshu Pathak

Rahul Sahu wrote:

Hi Divyanshu,

Consider  zero as a null value and displaying nothing for zero.

same like if null text "" dosent show anything.


Regards

Rahul Sahu

Hello Rajat and Rahul,

I edited my question a bit. Kindly go through it again?

Regards,

Divyanshu


2020-07-08 17-58-02
Suprio Roy

Hi ,

Are you passing the value of the input field as 0 or u r just keeping it blank ? If blank , then it should raise an error as mandatory field is left blank... otherwise if u try to save with the value 0 , then it will display 0 in the table record.


2020-06-08 06-48-23
Divyanshu Pathak

Suprio Roy wrote:

Hi ,

Are you passing the value of the input field as 0 or u r just keeping it blank ? If blank , then it should raise an error as mandatory field is left blank... otherwise if u try to save with the value 0 , then it will display 0 in the table record.



Hi Suprio,

As mentioned above, I passed the value 0. It shows 0 value in table records but doesn't show any value in input field.

Regards

Divyanshu


2020-07-08 17-58-02
Suprio Roy
Solution

Divyanshu Pathak wrote:

Suprio Roy wrote:

Hi ,

Are you passing the value of the input field as 0 or u r just keeping it blank ? If blank , then it should raise an error as mandatory field is left blank... otherwise if u try to save with the value 0 , then it will display 0 in the table record.



Hi Suprio,

As mentioned above, I passed the value 0. It shows 0 value in table records but doesn't show any value in input field.

Regards

Divyanshu



Hi Divyanshu,

It's a kind of drawback as 0 is considered as NULL. Please go through this thread for better clarification.


https://www.outsystems.com/forums/discussion/42152/null-is-not-0-os-drawback/ 

2021-08-26 18-09-47
João Santos
Champion

On the input field just add the attribute "show-default-value=true", and all will be good :)

works ok now:

UserImage.jpg
Priyanka Natraj

I tried this method , When i try to assign the above value in attributes it's throw error message in service studio and later service studio got collapsed and it got freeze

UserImage.jpg
inui shungo

あなたは最高です。

2024-04-04 02-59-50
Aaron Kasab

Hello

I had the same problem .Any news on this matter? 

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.