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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Autosave a form only o...
Power Apps
Unanswered

Autosave a form only on a specific field change.

(2) ShareShare
ReportReport
Posted on by 4
formContext.data.entity.save().
I am trying to autosave a form using above code. event handler: on change of a specific field.
Is it possible to do so? Because when I try to use above code and event handler, the form saves on change of any of the field on form.
Categories:
I have the same question (0)
  • Suggested answer
    Gabriel G. Profile Picture
    831 Super User 2025 Season 2 on at
    Hi!
     
    I suppose you try to save your form from Javascript ;). I suggest you to use Power Apps features if you can (business rule, calculated fields, PowerFX fields then save button). If you really need to save your entity from Javascript, yes you can use this:
     
    You need to bind the form on your function passing the context as parameter. And you need to make sure your Javascript function has parameter 'executionContext'.
     
    It should look like that:
     
    function newFunctionToSave(executionContext) {
        try {
               const formContext = executionContext.getFormContext();
          formContext.data.entity.save(saveOption)
             }
        } catch (error) {
            console.error("An error occurred in newFunctionToSave:", error);
        }
    }
     
    saveOptions is a parameter to indicates if you need to save and close or save and New Command (saveandclose, saveandnew). make sure to use this properly because you can create weird behaviors using that!
     
    I hope it helps!
    ___________________________________________________________
     
    Please click Does this answer your question if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it a Like.
  • sangu Profile Picture
    4 on at
    @GabGadou
    Thank you for your suggestion, I used the same code. but I registered it on "on change of field". but the form automatically saves on change of any field.
    how to make it change only on specific field change
  • sangu Profile Picture
    4 on at
    @GabGadou
    Could you please guide me how to autosave form using business rule

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard