Forum Discussion
Mirror Between document libraries based off Choice Column
- Apr 27, 2022
Update to this seeing as no one seems to know how to help:
As there might be someone looking for this in the future I'll include the solution here.
Good luck stranger, google is your friend!
I resolved it myself with the following flow structure:
- I needed to use the following expressions for the folder path in Copy File step:
take(triggerOutputs()?['body/{Path}'],sub(length(triggerOutputs()?['body/{Path}']),1))
- Made sure that the create folder step only runs if the folder is not present, and a join with a split function in the expression to take the file path without the root document library folder part and join it again:
join(skip(split(triggerOutputs()?['body/{Path}'],'/'),1),'/')
Then the copy file runs again and copies into the created folder.
The issue with my trigger condition was that I included spaces once I removed them it worked perfectly:
@equals(triggerBody()?['ExternalSharingDocuments']?['Value'],'Shared')
Finally, I will create a separate delete flow for any "Shared" documents deleted in the source library to delete them in the document portal.
Hope this helps someone.
Update to this seeing as no one seems to know how to help:
As there might be someone looking for this in the future I'll include the solution here.
Good luck stranger, google is your friend!
I resolved it myself with the following flow structure:
- I needed to use the following expressions for the folder path in Copy File step:
take(triggerOutputs()?['body/{Path}'],sub(length(triggerOutputs()?['body/{Path}']),1))
- Made sure that the create folder step only runs if the folder is not present, and a join with a split function in the expression to take the file path without the root document library folder part and join it again:
join(skip(split(triggerOutputs()?['body/{Path}'],'/'),1),'/')
Then the copy file runs again and copies into the created folder.
The issue with my trigger condition was that I included spaces once I removed them it worked perfectly:
@equals(triggerBody()?['ExternalSharingDocuments']?['Value'],'Shared')
Finally, I will create a separate delete flow for any "Shared" documents deleted in the source library to delete them in the document portal.
Hope this helps someone.