15
Views
3
Comments
Solved
How i clear the inserted fields?
Question

Hello, how i clear the fields which the user insert when him click in the button ok?


Rank: #94
Solution

Hello Francisco,

Hope you're doing well.

Do you want to clear those inputs when you press that "Ok" button, is that it?

If so, you just need to place an Assign widget in that action, assigning each of the variables binded to those inputs to their default values.


As far as I can tell, you have 2 text variables and 1 binary variable, so you should use empty string ("") for the text variables and NullBinary() for the binary variable in the Assign. Something like this:


You can check this documentation about default values for the OutSystems data types: https://success.outsystems.com/Documentation/11/Reference/OutSystems_Language/Data/Database_Reference/Default_Values_on_Database


Please be aware that if you are using the action (binded to "Ok" button) to save data in the database or any other logic, you should place this Assign widget after this logic. Most likely, it should be placed at the end of the flow.


Hope that this helps you!


Kind regards,

Rui Barradas

Rank: #688

Rui Barradas wrote:

Hello Francisco,

Hope you're doing well.

Do you want to clear those inputs when you press that "Ok" button, is that it?

If so, you just need to place an Assign widget in that action, assigning each of the variables binded to those inputs to their default values.


As far as I can tell, you have 2 text variables and 1 binary variable, so you should use empty string ("") for the text variables and NullBinary() for the binary variable in the Assign. Something like this:


You can check this documentation about default values for the OutSystems data types: https://success.outsystems.com/Documentation/11/Reference/OutSystems_Language/Data/Database_Reference/Default_Values_on_Database


Please be aware that if you are using the action (binded to "Ok" button) to save data in the database or any other logic, you should place this Assign widget after this logic. Most likely, it should be placed at the end of the flow.


Hope that this helps you!


Kind regards,

Rui Barradas

 Ok thank you, that´s resolved, thanks for all help :D

 

Hi Brito,

Take a local variable which has default variable and on click of that button  assign this local variable to the form holder variable and refresh the form. 

If you are getting it query copy that query and filter with dummy values where you get no records. assign this output to the form holder record.


You can also do it using the JavaScript. write some JavaScript to clear all the input fields in that form.


Regards,

Rama