logo
search
Others

How to Open Different Microsoft Forms from Power Pages Buttons

Huda QurayshiHuda Qurayshi Sep 25, 2026 869 views

Question details

The user needs to configure multiple buttons on a Microsoft Power Pages site to open different Microsoft Forms rather than loading the same form.

How to Open Different Microsoft Forms from Power Pages Buttons
Product
Microsoft Power Pages / Microsoft Forms
Device & OS
not provided
Scenario
Embedding multiple Microsoft Forms into a Power Pages interface where specific buttons trigger distinct forms via an iframe.
Observed behavior
Every button incorrectly opens the exact same Microsoft Form because the iframe URL or form identifier is not being updated dynamically upon button click.
Before you start

Ensure you have developer access to edit the source code (HTML/JavaScript) of your Power Pages site and have the unique sharing URLs for each Microsoft Form you want to embed.

Solution 1Recommended

Use JavaScript to Dynamically Assign the Form URL

Apply frontend development code to update the iframe's source URL depending on which button the user interacts with.

When embedding forms into an iframe on Power Pages, hardcoding the iframe's source will result in every button loading the same form. By utilizing HTML data attributes and a custom JavaScript event listener, you can pass the correct form identifier dynamically when a button is clicked.

1
Collect Microsoft Form URLs

Open Microsoft Forms, navigate to each form you wish to embed, click 'Collect responses', and copy the unique embed URL for each form.

2
Assign Data Attributes to Buttons

In your Power Pages HTML code, add a custom data attribute (e.g., data-form-url='YOUR_FORM_URL') to each button corresponding to the form it should open.

3
Implement JavaScript Event Listeners

Write a JavaScript function that listens for a click event on these buttons. The function should extract the URL from the clicked button's data attribute and assign it to the 'src' attribute of your target iframe.

4
Test the Integration

Save your code, clear your portal cache, and click each button on the Power Pages site to verify that the iframe dynamically loads the correct form.

Use JavaScript to Dynamically Assign the Form URL
Development Required: This solution requires basic knowledge of HTML and JavaScript. Always test your code in a development environment before pushing to a live site.
Free Microsoft Office alternative

Looking for Simpler Workflows? Try WPS Office

If you are tired of complex coding and integrations in Microsoft environments for simple data collection and document processing, WPS Office offers a free, lightweight, and highly compatible alternative to Microsoft Office.

  1. 1. Download the Installer: Visit the official WPS Office website and download the free installation package for your device.
  2. 2. Install WPS Office: Run the setup file and follow the simple on-screen instructions to install the suite.
  3. 3. Open and Edit Your Files: Launch WPS Office to instantly open your existing Microsoft documents and start managing your data.
Fully compatible with Microsoft Excel, Word, and PowerPoint formatsProcess data and manage form responses seamlessly in WPS SpreadsheetsLightweight application that runs smoothly across multiple operating systemsFree to use with a familiar, user-friendly interface requiring no custom code
microsoft office alternative - wps office

Frequently Asked Questions

Why do all my Power Pages buttons open the exact same Microsoft Form?

This happens when the iframe URL or form identifier is hardcoded into the page. Clicking any button simply reloads the same hardcoded source instead of dynamically assigning a new form URL to the iframe.

Do I need to write code to embed multiple Microsoft Forms in Power Pages?

Yes, while embedding a single form using an iframe is straightforward, making multiple buttons dynamically change a single iframe's content requires custom JavaScript or Liquid coding.

Where can I get specialized help for troubleshooting Power Pages code?

For advanced implementation issues, you can post your code and details on Microsoft Q&A (learn.microsoft.com/en-us/answers/) or in the Microsoft Forms Tech Community for specialized developer assistance.