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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Patch() function - how...
Power Apps
Answered

Patch() function - how to keep from resetting a Custom Canvas Page after the Patch as the Users wish to continue with the data that is on that page

(0) ShareShare
ReportReport
Posted on by 12

I hope my subject clearly states the problem.  We have a custom canvas page (inside a Model Driven App) with data field values that we want to update a table using Patch() function (which works fine) but the patch() clears the page of all the data values and our users still need that data in order to continue to do more work (after they issue a SAVE which triggers the Patch() function)) with that data and select other data...   I have tried this...

 

Patch('Install Schedules', 'ComboBox-Site'.Selected, {'Avail Record':'ComboBox-Avail'.Selected});
Set(gblResetInputs,true);Set(gblResetInputs,false);
Notify("Save is Successful!", NotificationType.Success, 3000); // 3 second display

 

Categories:
  • BCBuizer Profile Picture
    22,854 Super User 2026 Season 2 on at

    Hi @Bapa ,

     

    I see you are using a variable to reset the controls after executing the Patch. Did you set the Default properties of the controls that are reset so they get the value the user should see?

  • Bapa Profile Picture
    12 on at

    Hello @BCBuizer 

    thank you for your reply.  I am just a few weeks new to Power Apps/Automate/etc.

    In my little test case I have two (2) comboboxes...I see a DefaultSelectedItems property for these 2 combos. And I have a TEXT box and do not see any property that relates to Default.

     

    Not sure what you are referring to with "I see you are using a variable to reset the controls...".  the two (2) Set(gblResetInputs,true);Set(gblResetInputs,false); are just something I found in some video/website that said this might help retain the values. I can remove them and still get same result...page gets refreshed so we lose the data.

  • Bapa Profile Picture
    12 on at

    addendum @BCBuizer 

    I forgot to say... the first combobox presents a list from a Dataverse table...select one row. That row then uses a Filter() to select what a 2nd Dataverse table displays in the 2nd combobox. After the row is selected in 2nd combobox one of its fields is then displayed in the TEXT box.  Of course my real world app will display a bunch of text boxes.

    Thank you. Bapa

  • BCBuizer Profile Picture
    22,854 Super User 2026 Season 2 on at

    Hi @Bapa ,

     

    Thanks for the clarifications. Can you please share the DefaultSelectedItems properties for both combo boxes? 

  • Bapa Profile Picture
    12 on at

    @BCBuizer 

    Apologize for the delay.   Both of them are "empty" (nothing).  I will google this property as I await a reply from you. Thank you!

  • Verified answer
    BCBuizer Profile Picture
    22,854 Super User 2026 Season 2 on at

    Hi @Bapa ,

     

    So that seems to be the issue. If those are blank, after resetting, the value will be blank as well. You will need to insert a Power FX reference to the item that should be selected in the combobox.

     

    For 'ComboBox-Avail' this will probably look something like:

    'ComboBox-Site'.Selected

     However, this will only work in case 'ComboBox-Site' has an item selected, so the DefaultSelectedItems property of that control will need to be addressed as well.

  • Bapa Profile Picture
    12 on at

    @BCBuizer 

    Your guidance led me to a video showing how to set the DefaultSelectedItems property. I now have it working as I had hoped could be possible...lots to learn! Another of the more than a dozen languages I have learned over the years! LOL! Thank you!

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 383 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 356

#3
WarrenBelz Profile Picture

WarrenBelz 232 Most Valuable Professional

Last 30 days Overall leaderboard