Hello everyone !
I have a reaaally big question.
SharePoint Online, MS Flow :
I have created Site Pages on Site A and on Site B.
On Site B SitePages Library, I have IDs going up to 135.
Then, in a "Apply to each" loop, running through a SP List with SP Sites URLs, I am copying a SitePage from one Site A to another Site B.
In Flow, I am using the SharePoint Action "Copy File" with the settings below :
On Site A, my original SitePage has the ID 67.
On Site B, my copied SitePage also has the ID 67.
Here are my really important questions :
I tried with the "Copy file with a new name", and on my Site B, the copied/pasted SitePage increments the IDs as usual : now I have ID 136. BUT, I also have 2 pages with the same title but with different names.
This solution is not effective, because : what if the flow -which is running with a "apply to each" on a list of Sites- fails ?
I mean, it fails on 2-3 sites. I want to re-run it, so it will try to copy again on sites it already succeeded. I will have several pages with the same title but different names and IDs....
So, please tell me if my interpretations of CopyFile are accurate and telle me your solutions / workarounds
Thanks !
Gaëlle, forever grateful to who teaches me something.
Hi @Anonymous,
I have tested on my side and reproduced your issue, it's truly will copy original SitePage ID to the destination SitePage.
There are two situations:
1. Copy original SitePage with name test.aspx and ID is 10 to destination Site, replace if another file is already there, the site page name will be test.aspx and ID will be 10.
2. Copy original SitePage with name test.aspx and ID is 10 to destination Site, copy with a new name if another file is already there, the site page name will be test1.aspx and ID will change.
The answer to two questions:
Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hello @v-litu-msft !
First, thank you for your answer, I figured it out myself too.
But yes, as you said, the ID are replaced. And I am really concerned about "Will it replace the content of the page with existing ID with the new content?" Flow/SP only checks for name...
To prevent any unwanted behavior, I tried to add a Get file content using Path to check if the SitePage already exists.
Then I added 2 parallel branches for copying :
But this brings a new and different problem :
When the "Get file content using Path" action fails, my following actions are well ran, and they succeed. BUT, my Flow's run status is set to FAIL. I don't want to scare my users nor I want them to file bugs everytime they see the flow failing, because it is an intended failure.
Do you have a workaround for me please ?
Thanks!
Hi @Anonymous,
Though the ID exists in the destination site, the copied file will still set a new ID.
However, your method is brilliant, I don't know about your Flow structure, if you want an action failed, flow still run and status is successful, maybe you want this feature:
Only the previous action failed, the Compose will perform, I hope it can help you.
Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
Announcing a new way to share your feedback with the Power Automate Team.
Learn to digitize and optimize business processes and connect all your applications to share data in real time.
User | Count |
---|---|
72 | |
23 | |
17 | |
17 | |
13 |
User | Count |
---|---|
125 | |
34 | |
31 | |
28 | |
26 |