Clear the field to Blank using Reset on edit

Hello guys,

I need a help.

I have a screenshot here

1.png

When i click Man Downtime in the button [Category]. The Man Downtime Enum will show. And i put in its initial value is "". Means Blank. Correct me if i am wrong.

Let say i choose value from the Enum [Man Downtime], No Manpower available.

Then, when i change a category. I want the field of [Man Downtime] reset to its initial value BLANK.

I tried the expression

IFS([Category = "Machine Downtime",""),[Category = "Operational Downtime","",[Category = "Non Operational Downtime","") etc.etc..

But it didn't work. I hope someone help me 😔

Thanks in advance!

 

 

Solved Solved
0 5 138
1 ACCEPTED SOLUTION

Aurelien
Google Developer Expert
Google Developer Expert

Hi @JhunePol 

You may want to use two things.

1) show_if expression

I guess you have a column [Man downtime] which you want to appear on selecting the category "Man Downtime".

You will need to use the expression:

[Category]="Man Downtime"

The same if you have a column [Machine Downtime], you will use this show_if expression: 

[Category]="Machine Downtime"

Aurelien_0-1731996785769.pngAurelien_1-1731996805563.png

Aurelien_2-1731996834767.png

2) about the initial value:

for each column, you will need to set the initial value expression.

For [man downtime] column:

IF([category]="Man Downtime", "No manpower available", "")

For [machine downtime] column:

IF([category]="Machine Downtime", "No machine available", "")

and so on.

Aurelien_3-1731996981420.png

PLEASE NOTE:

Initial value expression will be respected until the user manually changes somethings, so it won't be re-calculated anymore after that on the same form edition.

With this option, it will be recalculated on a new edition:

Aurelien_5-1731997189121.png

However, if the user is not supposed to update it, then I would suggest to use to disable the "editable" option:

Aurelien_4-1731997116414.png

 

View solution in original post

5 REPLIES 5

Aurelien
Google Developer Expert
Google Developer Expert

Hi @JhunePol 

You may want to use two things.

1) show_if expression

I guess you have a column [Man downtime] which you want to appear on selecting the category "Man Downtime".

You will need to use the expression:

[Category]="Man Downtime"

The same if you have a column [Machine Downtime], you will use this show_if expression: 

[Category]="Machine Downtime"

Aurelien_0-1731996785769.pngAurelien_1-1731996805563.png

Aurelien_2-1731996834767.png

2) about the initial value:

for each column, you will need to set the initial value expression.

For [man downtime] column:

IF([category]="Man Downtime", "No manpower available", "")

For [machine downtime] column:

IF([category]="Machine Downtime", "No machine available", "")

and so on.

Aurelien_3-1731996981420.png

PLEASE NOTE:

Initial value expression will be respected until the user manually changes somethings, so it won't be re-calculated anymore after that on the same form edition.

With this option, it will be recalculated on a new edition:

Aurelien_5-1731997189121.png

However, if the user is not supposed to update it, then I would suggest to use to disable the "editable" option:

Aurelien_4-1731997116414.png

 

Thank you so much @Aurelien. Really Appreciated. 😊

Hi, @Aurelien

Btw I'm done in your suggestion #1. Thank you, really appreciated.

My all [Category] has initial value "" blank.

My problem is sometimes my end users forgot to clear the value when they change from another category.

Example: Let say my user was enter "No manpower due to typhoon", then my user suddenly change the category to [Machine Downtime] and he enter "Machine trouble".

I want that [Man Downtime] change to blank. I want that "No manpower due to typhoon" will change as blank.

 

Hi @JhunePol 

As I said, once the user update anything in the [man downtime] column, the initial value won't be calculated anymore.

You may want to use a "Grouped: execute a sequence of actions"  on a form save event to "clean after save" if that happens.

Aurelien_1-1731999188389.png

For reference:

Actions: The Essentials - AppSheet Help

Run actions based on view events - AppSheet Help

Aurelien
Google Developer Expert
Google Developer Expert

You are welcome ! 🙂

Top Labels in this Space