Fix Power Automate Flow Cannot Be Triggered for Testing in SharePoint
Question details
The user needs to resolve an issue where a Power Automate flow fails to trigger during testing when trying to copy course pages between Teams-connected SharePoint sites.

- Product
- Power Automate and SharePoint
- Device & OS
- not provided
- Scenario
- Testing a flow designed to copy modern SharePoint course pages between two Teams-connected SharePoint sites.
- Observed behavior
- The system displays the error message 'This Flow Cannot Be Triggered for Testing' and halts the process.
Ensure you have SharePoint administrator privileges and have the SharePoint Online Management Shell installed before modifying site script settings.
Enable Custom Scripts via SharePoint Online Management Shell
Copying modern SharePoint pages between sites often requires custom scripting to be enabled on both the source and destination sites to function properly.
By default, SharePoint restricts custom scripts on modern sites for security reasons. Disabling the DenyAddAndCustomizePages setting allows Power Automate to copy the structural elements of modern pages correctly.
Launch Windows PowerShell on your computer as an Administrator.
Run the command 'Connect-SPOService -Url https://[yourdomain]-admin.sharepoint.com' and log in with your global or SharePoint admin credentials.
Run the command 'Set-SPOSite -Identity [SourceSiteURL] -DenyAddAndCustomizePages 0' to allow custom scripts on the source site.
Run the command 'Set-SPOSite -Identity [DestinationSiteURL] -DenyAddAndCustomizePages 0' to allow custom scripts on the destination site.
Return to Power Automate and trigger the test again to see if the error is resolved.
Isolate the Issue and Contact Microsoft Support
If adjusting permissions does not resolve the problem, it may be a specific Power Automate testing bug affecting Teams-connected sites.
Boost Your Document Productivity with WPS Office
While troubleshooting SharePoint and Power Automate workflows, consider switching to WPS Office for your daily document needs. It offers a lightweight, highly compatible alternative to Microsoft Office, ensuring seamless creation and editing of Word, Excel, and PowerPoint files without complex subscriptions.

Frequently Asked Questions
Why does copying modern SharePoint pages require custom scripts to be enabled?
Modern SharePoint pages contain complex underlying structures and specialized web parts. Enabling custom scripts (by disabling DenyAddAndCustomizePages) gives automation tools like Power Automate the necessary permissions to accurately duplicate these structural elements across sites.
Why does my flow work on Communication sites but fail on Teams-connected sites?
Teams-connected SharePoint sites are backed by Microsoft 365 Groups, which enforce stricter default security policies and permission scopes compared to standalone Communication sites. This can cause testing errors in Power Automate when permissions are not explicitly aligned.
Can I run my Power Automate flow without using the Test button?
Yes. Sometimes the manual testing environment in Power Automate experiences UI-specific errors. You can save your flow, exit the editor, and trigger it natively (e.g., by adding a file or clicking a manual trigger button in the run interface) to bypass the testing restriction.




