55
Views
12
Comments
How to use input field with value 0 or "not yet encoded"

Hello everyone,

I need help, I need the output where if I don't want to input any value it will tag as "not yet encoded" and if 0 as is the value was 0 using input field.

Here's my scenario:

1. In this step, when I input a value of 0 it means the value was 0 as is, then if I don't want to answer this input field so the answer/ it will tag as "not yet encoded".

Thanks,
Ally

2024-05-08 06-29-37
Prince Aadil Khan Panwar

Hi A L L Y ,

You can use the text below the input and you can use the if condition 

you can apply the regex search which will check the value is null or not. because 

Outsystems assumes 0 as nullidentifier() .

then it should be visible 

you can give the text " not yet encoded " and you can make color as red of text by css 

if still not clear please try to explain with screenshots what exactly you want to do. 

thanks 

Prince

2023-06-27 05-52-18
A L L Y

Hello @Prince Aadil Khan Panwar,

The data type of this two-input field is Decimal, how can I even store the "Not Yet Encoded" as text?

In this screenshot where the user is not mandatory to input their entry therefore, if the user don't want to input their entry it will store or tag in the database/exported file as "Not Yet Encoded". However, if the user input their entry as 0 it will store in the db as 0.

Thanks,
Ally

2024-05-08 06-29-37
Prince Aadil Khan Panwar

Take the text widget below the input, you can show as required field shows up

2024-05-08 06-29-37
Prince Aadil Khan Panwar

do this 

1. take a text variable

2. and check on initialize screen action with the regext is null or not 

3. if its null then put the text like this 

4. and then assign the text variable into prompt like this 

result, ignore check box



2023-06-27 05-52-18
A L L Y

Hello @Prince Aadil Khan Panwar,

Sorry for the late reply, do you have example by any chance? I don't know it is possible your solution because all of my input field the data type is Decimal.

Thanks,
Ally

2024-05-08 06-29-37
Prince Aadil Khan Panwar

here it is , try to take help from this . 

AssignmentNotyetencoded.oml
2023-06-27 05-52-18
A L L Y

Hello @Prince Aadil Khan Panwar,

Still, I can't apply your example, here's the example of my input field:



Well, as you can see it is not mandatory to have a value of the "Null Value" but when in the client side it will show the input field has the null value of 0.

Note: I'm using Traditional

2021-09-06 15-09-53
Dorine Boudry
 
MVP

Hi @A L L Y ,

OutSystems doesn't cater for the difference between a value of zero, and a value of 'not entered'.  

One possible solution, is to add an extra boolean in your datamodel (somewhere near that decimal) named something like QuantityIsNotEncoded.

In your UI, where you are only displaying this information, you can use something like an if widget with condition QuantityIsNotEncoded, and have a 'not encoded' text in the true, and the value in the false branch.

In your UI, when you want to let the user enter a value, you'll have to probably use a text input instead of a number input, maybe combined with a mask.  This is a bit messy and error prone.

Depending on how your users want to see it, I would maybe explore some sort of UI where they actively choose themselves between entering or not entering  a value, and then you can use a normal number input.

Dorine

2023-06-27 05-52-18
A L L Y

Hello @Dorine Boudry,

Sorry for the late reply, do you have example by any chance? I'm new in Traditional.

Thanks,
Ally

2021-09-06 15-09-53
Dorine Boudry
 
MVP

no, 

but what part are you struggling with ?

2023-06-27 05-52-18
A L L Y

Thanks for your help, I already discuss it to @Prince Aadil Khan Panwar, so I don't have much time to tell you and to discuss it again.

2021-09-06 15-09-53
Dorine Boudry
 
MVP
Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.