Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Using Flows
Unanswered

Dynamic sync between two SharePoints where a value in a file's column value determines if the file is copied

(0) ShareShare
ReportReport
Posted on by

This has been driving me nuts for hours on end please help.

I am a marketer that had a "General Marketing" SharePoint in SharePoint used by my fellow marketers. We are trying to create a flow where files from the "General Marketing" gets copied to a "Brand Center" SharePoint if there is the value "Brand Center" tag selected in a choice column of the file. We also want it so if we remove this tag in "General Marketing" SharePoint, the file will be deleted in the "Brand Center SharePoint". 

This is the flow instructions Im working with provided by a friend, but it doesn't seem to work. Any help would be appreciated!

 


1. Configure the Trigger:

  • In "Site Address," select the URL of your source SharePoint site/library from the dropdown or enter it manually.
  • For "List Name," select the source document library where your files are stored.
  • Click on "Create."

2. Add a Condition:

  • Click on "+ New step."
  • Search for "Condition" and select it.
  • In the "Choose a value" field (left box), click on the "Add dynamic content" and select "Sync Value" from the trigger outputs.
  • In the middle dropdown (between the boxes), ensure it's set to "is equal to."
  • In the "Enter a value" field (right box), manually type "Brand Center."

3. If Yes (actions when the condition is met):

  • 3.1. Check if the file exists in the destination:

    • Click on "+ Add an action" under the "If yes" side of the condition.
    • Search for "SharePoint Get files (properties only)" action and select it.
    • Set the "Site Address" to your destination SharePoint library's URL.
    • For "List Name," select your destination library.
    • In the "Filter Query" box, type FileLeafRef eq '@{triggerOutputs()?['headers']['x-ms-file-name-encoded']}'. This checks for a file with the same name in the destination library.
  • 3.2. Next, Add a Condition to check if the file was found in the destination:

    • Use the "length" function: length(body('Get_files_(properties_only)')?['value']) is greater than 0.
  • 3.2.1. If the file exists (under the above condition's "If yes"):

    • Use the "Update file" action for SharePoint. Choose the appropriate file identifier from the results of "Get files (properties only)" and update with the source file's content.
  • 3.2.2. If the file doesn’t exist (under the above condition's "If no"):

    • Use the "Create file" action for SharePoint. Set the destination path and use the content from the source file.
  • 4. If No (actions when the condition is not met):
    • 4.1. Check if the file exists in the destination (similar to step 3.1).
    • 4.2. Use another Condition to check if the file was found (similar to step 3.2).
    • 4.2.1. If the file exists (under this condition's "If yes"):
      • Use the "Delete file" action for SharePoint. Choose the appropriate file identifier from the results of "Get files (properties only)."
  • Michael E. Gernaey Profile Picture
    40,720 Super User 2025 Season 1 on at
    Re: Dynamic sync between two SharePoints where a value in a file's column value determines if the file is copied

    Firstly, @mantis480 

     

    I love you lol metaphorically speaking because I love your layout and how you typed it. its amazing.

     

    Now the only thing really missing is a description of what you mean by "it doesn't work". Since we aren't looking at a flow but a meta-explanation (still love it), there isn't anything in here the defines wrong.

     

    Can you clarify what is wrong so we can focus on that step?

     

    Also, if you are saying that the Condition is not working, then please add a Condition, prior to the Condition and output the value you are trying to compare in this case Sync Value, so that we can make sure its got the data you expect.


    If I have helped you, I would really appreciate if you please Mark my answer as Resolved/Answered, and give it a thumbs up, so it can help others

    Cheers

    Thank You
    Michael Gernaey MCT | MCSE | MCP | Self-Contractor| Ex-Microsoft
    https://gernaeysoftware.com
    LinkedIn: https://www.linkedin.com/in/michaelgernaey

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,601 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,946 Most Valuable Professional

Leaderboard

Featured topics

Restore a deleted flow