web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Power Pages - General Discussions
Suggested answer

Clearing the field values in SharePoint Form from powerapps

(1) ShareShare
ReportReport
Posted on by 168
I have a SharePoint form customized using power apps. 
the form has one dropdown choice field. 
i have a context variable on the on change event of the dropdown to set 
 
 
then in the default value of a textbox i have a code 
If(varreset=true,Blank(), Parent.Default);
so if the dropdown changes then clear the textbox value
on the form visible i am updating the varreset to false so that when the form load again the value goes back to false
the problem i have having is once the reset value changes to true it is never changing back to false when i open another item, either new, or view or edit item it is always true. 
i have to do CTRL+F5 to refresh the screen multiple times to reset the context value to false again. 
 
the idea was to reset some of the textbox values when the dropdown changes so that user can enter new data. 
 
Anything i am doing wrong here?
Categories:
I have the same question (0)
  • KDAI Profile Picture
    168 on at
    Clearing the field values in SharePoint Form from powerapps
    I tried the resetting the control. this is a SharePoint form in canvas app. none of them worked. 
     
    even with global variable the variable doesn't reset to false when I open another form without refreshing the screen. 
     
    if you work on another item right from one then it will still give the false values in the form. 
     
     
  • Suggested answer
    Inogic Profile Picture
    1,055 Super User 2025 Season 2 on at
    Clearing the field values in SharePoint Form from powerapps
    Hi,
     
    Your varreset variable is not resetting to false on opening a new or different item, because context variables (UpdateContext) are scoped to the screen and do not automatically reset between items in SharePoint custom forms.
    So even when you open another item, the screen stays the same, and varreset is still true — hence the textbox stays blank.
    Refer to the points given below,
    1. Use Reset() instead of managing state with varreset:
    Instead of relying on a flag (varreset) to clear the textbox, use Reset(txtInputName) directly in the dropdown’s OnChange property.
    Reset(txtYourTextboxName)
    This will immediately reset the textbox when the dropdown changes — no need for an extra context variable.
    1. If you still want to use varreset :
    You must ensure it is reset properly each time the form is opened.
    So, in your form's OnVisible property (or the screen's), add this:
    UpdateContext({varreset: false});
    But here's the catch: sometimes OnVisible doesn’t trigger reliably in customized SharePoint forms, especially when switching between Edit/New/View modes. So consider placing the reset logic in the OnSuccess or OnReset of the form too — or even better, in the dropdown’s OnChange logic directly.
    1. Alternative: Use a global variable if needed across screens:
    2. Set(varreset, false)
    But in your case, just using Reset() on the control is cleaner.
     
    Hope this helps.
     
    Thanks!
    Inogic

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

MS.Ragavendar – Community Spotlight

We are honored to recognize Ragavendar Swaminatha Subramanian as our September…

Leaderboard > Power Pages

#1
Jon Unzueta Profile Picture

Jon Unzueta 100 Super User 2025 Season 2

#2
Shafiuddin Profile Picture

Shafiuddin 43

#3
Jerry-IN Profile Picture

Jerry-IN 32

Last 30 days Overall leaderboard