cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Gorilla_8
Super User
Super User

CLEAN THE FIELD WHEN THE USER SAVES UNDER SOME CONDITIONS

I have several forms divided into tabs, with my SharePoint database

 

About the fields:

 

Some fields appear depending on the choices of another field, so I would like to clear the field or reset it only when the user saves and that specific condition is active.

 

For example:

 

There is a field with two choices:

 

Yes or No.

 

If the user chooses "Yes" a multiple line text field appears, and if he chooses "No" the field does not appear and will be reset or cleared when he saves (click on a button)

 

There is also another condition with Checkbox fields, if the user selects the specific option, clears or resets the field when he saves

 

I tried to use a variable to reset, but it does not clear the field, it saves the same way.

 

In my "SubmitButton" it has functions like "Patch", I don't know if it will influence anything.

 

Thanks for all the help!

22 REPLIES 22
Gorilla_8
Super User
Super User

@JR-BejeweledOne 

 

before the patch on varMode="Edit"

JR-BejeweledOne
Super User
Super User

What you have to understand is how the Default formula on your text box is affecting this:

 

Your text box has this formula in the 'Default' property:

 

PlainText(ThisItem.NameOfTheField)

 

This means if 'ThisItem.NameOfTheField' is blank this will be blank and if 'ThisItem.NameOfTheField' has a value, this will have a value.  Reset only sets a field back to it's default value.   If the default value is not blank, then reset can't make it blank.

 

So you have to modify the text field's 'Default' formula or nothing is going to change. 

 

Modify the formula in your text field 'Default' property:

 

If (

 

'BI?Radio_3'.Selected.Value = "Yes", PlainText(ThisItem.NameOfTheField),
'BI?Radio_3'.Selected.Value = "No" And resetItem, ""
)

 

 



If you like this post, give it a Thumbs up. If it answered your question, Mark it as a Solution to enable other users find it.
Gorilla_8
Super User
Super User

@JR-BejeweledOne 

 

I'm still trying to make this solution, @JR-BejeweledOne , I didn't give up, just structuring my test application better

 

Just so you know

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (3,166)