How to Open Different Microsoft Forms from Power Pages Buttons
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.

- 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.
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.
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.
Open Microsoft Forms, navigate to each form you wish to embed, click 'Collect responses', and copy the unique embed URL for each form.
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.
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.
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.

Seek Specialized Help in Microsoft Developer Communities
If you encounter complex iframe routing issues or sandbox restrictions in Power Pages, consult Microsoft's specialized forums.
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. Download the Installer: Visit the official WPS Office website and download the free installation package for your device.
- 2. Install WPS Office: Run the setup file and follow the simple on-screen instructions to install the suite.
- 3. Open and Edit Your Files: Launch WPS Office to instantly open your existing Microsoft documents and start managing your data.

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.




