Skip to main content

Notifications

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 166
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:
  • KDAI Profile Picture
    166 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
    993 Super User 2025 Season 1 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

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Leaderboard > Power Pages - General Discussions

#1
WarrenBelz Profile Picture

WarrenBelz 9 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 7 Super User 2025 Season 1

#3
Rondel Profile Picture

Rondel 6

Overall leaderboard