logo
search
Others

Fix Power Automate Flow Cannot Be Triggered for Testing in SharePoint

Khadija KhanKhadija Khan Oct 23, 2026 869 views

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.

Fix Power Automate Flow Cannot Be Triggered for Testing in SharePoint
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.
Before you start

Ensure you have SharePoint administrator privileges and have the SharePoint Online Management Shell installed before modifying site script settings.

Solution 1Recommended

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.

1
Open PowerShell

Launch Windows PowerShell on your computer as an Administrator.

2
Connect to SharePoint Service

Run the command 'Connect-SPOService -Url https://[yourdomain]-admin.sharepoint.com' and log in with your global or SharePoint admin credentials.

3
Modify Source Site Settings

Run the command 'Set-SPOSite -Identity [SourceSiteURL] -DenyAddAndCustomizePages 0' to allow custom scripts on the source site.

4
Modify Destination Site Settings

Run the command 'Set-SPOSite -Identity [DestinationSiteURL] -DenyAddAndCustomizePages 0' to allow custom scripts on the destination site.

5
Retest the Flow

Return to Power Automate and trigger the test again to see if the error is resolved.

Security Note: Allowing custom scripts can introduce security risks. It is recommended to re-enable the setting by changing the value back to '1' once your workflow copy is complete.
Free Microsoft Office alternative

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.

Fully compatible with Microsoft Word, Excel, and PowerPoint formats (.docx, .xlsx, .pptx).Lightweight design ensures fast launch times and smooth operation on any device.Familiar, intuitive user interface requires zero learning curve for Microsoft Office users.Built-in PDF toolkit allows you to edit, convert, and sign documents effortlessly.
QA img-9

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.