Skip to main content

Notifications

Power Pages - General Discussions
Unanswered

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

(0) ShareShare
ReportReport
Posted on 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
    SaiRT14 1,926 on at
    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

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

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

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,475

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,767

Leaderboard