Hi,
I am trying to create a flow that would ensure that the contents of a OneDrive for Business folder are replicated and updated in Dropbox. I can't figure out how to do. I've tried "when a file is modified" in ODfB to "create file" in Dropbox, which creates a file when it one doesn't exist but doesn't update an existing file. The "update" operation seems to be limited to individual, pre-existing files. Not sure if what I'm looking for can be done?
@v-xida-msft wrote:Hi @Adanedhel,
Could you please share a screenshot of your flow's configuration?
Do you want to sync files within your OneDrive for Business folder into your Dropbox folder?
I have made a test and the issue is confirmed on my side. If the file (pre-existing file) has been existed in your Dropbox folder, when you modified the same file within your OneDrive for Business folder, the "Create file" action would fail, the modified file would not be updated into your Dropbox folder.
If you want to update the pre-existing file within your Dropbox folder when the same file is modified in your OneDrive for Business folder, you should check if the modified file is existed in your Dropbox folder firstly.
I have made a test on my side and please take a try with the following workaround:
- Add a "When a file is modified (properties only)" trigger, specify Folder.
- Add a "Get file content" action, File field set to Id dynamic content of the trigger.
- Add a "List files in folder" action, specify Folder.
- Add a "Filter array" action, From set to output of the "List files in folder" action, within condition box, click "Edit in advanced mode", type the following formula:
@equals(item()['DisplayName'], triggerBody()?['DisplayName'])
- Add a Condition, click "Edit in advanced mode", type the following formula:
@empty(body('Filter_array'))Within "If/yes" branch of Condition, add a "Create file" action, specify Folder Path, File Name set to Display name dynamic content of the trigger, File Content field set to File content dynamic content of the "Get file content" action.
Within "If/no" branch of Condition, add a "Apply to each" action, input parameter set to output of the "Filter array" action. Within "Apply to each" action, add a "Update file" action, File field set to Id dynamic content of the "Filter array" action, File Content field set to File content dynamic content of the "Get file content" action.
Note: Use the "When a file is modified (properties only)" trigger as the trigger of your flow rather than the "When a file is modified" trigger.
Image reference:
The flow works successfully as below:
Best regards,
Kris
Hye Kris,
This works only for the first time but when I modified the same file again in ODFB dropbox didn't change anything. Please take a look.
Hi @Adanedhel,
Could you please share a screenshot of your flow's configuration?
Do you want to sync files within your OneDrive for Business folder into your Dropbox folder?
I have made a test and the issue is confirmed on my side. If the file (pre-existing file) has been existed in your Dropbox folder, when you modified the same file within your OneDrive for Business folder, the "Create file" action would fail, the modified file would not be updated into your Dropbox folder.
If you want to update the pre-existing file within your Dropbox folder when the same file is modified in your OneDrive for Business folder, you should check if the modified file is existed in your Dropbox folder firstly.
I have made a test on my side and please take a try with the following workaround:
@equals(item()['DisplayName'], triggerBody()?['DisplayName'])
@empty(body('Filter_array'))
Within "If/yes" branch of Condition, add a "Create file" action, specify Folder Path, File Name set to Display name dynamic content of the trigger, File Content field set to File content dynamic content of the "Get file content" action.
Within "If/no" branch of Condition, add a "Apply to each" action, input parameter set to output of the "Filter array" action. Within "Apply to each" action, add a "Update file" action, File field set to Id dynamic content of the "Filter array" action, File Content field set to File content dynamic content of the "Get file content" action.
Note: Use the "When a file is modified (properties only)" trigger as the trigger of your flow rather than the "When a file is modified" trigger.
Image reference:
The flow works successfully as below:
Best regards,
Kris
WarrenBelz
146,743
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
66,079
Most Valuable Professional