Skip to main content

Notifications

Community site session details

Community site session details

Session Id : MjZO+Ijhc/xQQydLbUgdSi
Power Pages - General Discussions
Unanswered

Bug Report: Form Submission Issue on Page Refresh in Power Pages

Like (0) ShareShare
ReportReport
Posted on 10 Oct 2024 07:32:53 by
Hi everyone,
 
I encountered an issue in Microsoft Power Pages where refreshing the page after submitting a form results in duplicate records being created.

Steps to Reproduce:

  1. Create a Form in Power Pages to create a new record in the Dataverse.
  2. Configure the post-submit action to display a success message after the record is created.
  3. Submit the form to create a new record. The success message will be displayed as expected.
  4. Press F5 to refresh the page.
  5. The system will display a prompt warning that refreshing the page will re-submit the form.
  6. Click OK to proceed with the refresh.

Expected Result:
The page should refresh without any warning. 

Actual Result:
After refreshing the page and clicking OK on the prompt, the form is re-submitted, resulting in a duplicate record being created in the database.

Categories:
  • Suggested answer
    SaiRT14 Profile Picture
    1,961 Super User 2025 Season 1 on 19 Oct 2024 at 13:55:02
    Bug Report: Form Submission Issue on Page Refresh in Power Pages
    1. Use Redirect After Form Submission
    In Power Pages, configure your form's post-submit action to redirect to another page after the submission is successful.
    You can do this by setting the Redirect URL in the form settings, which will take the user to a different page (such as a thank-you page) after submitting the form.
    After the form is submitted, use JavaScript to reset the form, so that when the page is refreshed, the form data is not re-submitted.
    $(document).ready(function () {
        $('#formId').on('submit', function () {
            // Your form submission logic here
            
            // Reset the form after submission to avoid resubmission
            $(this).trigger('reset');
        });
    });

    Use JavaScript to Prevent Duplicate Submissions
    $(document).ready(function () {
        $('#formId').on('submit', function (e) {
            e.preventDefault();
            // Disable the submit button to prevent further submissions
            $('#submitButtonId').prop('disabled', true);
            
            // Your form submission logic here
            // Optionally, use an AJAX request to submit the form without triggering a page reload
        });
    });

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

Thomas Rice – Community Spotlight

We are honored to recognize Thomas Rice as our March 2025 Community…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,508 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,369 Most Valuable Professional

Leaderboard
Loading started
Loading complete