Hey there,
I'm building a Flow where once an item in one library has a condition that changes (paperwork status set to "reconciled", in our case), I then want to move that file to a different library, complete with all of its metadata. I've tried doing this both as a Copy File action and a Create File (with content) action. In both cases, this works great with a Word document (.docx) but with a PDF the destination file comes across missing all of its metadata.
I thought... okay, I'll just update the properties of that destination file, no biggie. However, as you'll see from the screenshot, the destination file created by the "Copy File" action does not produce an ID I can then reference in the ID field (note, the ID field you see below is for the original source file, not the destination).
This seems like a bug to me, no?
Any help appreciated,
Sean
Hi @swallbridge,
Could you please share a full screenshot of your flow’s configuration?
Which property that you would like to update with, the file itself, or the added column fields in the Library?
If you want to update the property of file itself, please consider take a try to switch “Update file properties” action into “Update file” action:
If you want to update the property of added column fields in the library, please take a try with the following workaround:
Add a Condition 2, click “Edit in advanced mode”, type the following formula:
@equals(body('Get_file_metadata_2')?['DisplayName'], body('Get_file_metadata')?['DisplayName'])
Within “If/yes” branch of Condition 2, add a “Update file properties” action, Id field set to ID dynamic content of “Get files (properties only)” action.
Image reference:
Best regards,
Kris
Hi @v-xida-msft,
Many thanks for the thoughtful response. Below is my current flow with where I'm stuck trying to get the ID. I did try your suggestions (apply to each, etc.) but I seem to get the same result in the end, being unable to get the ID of the destination/copied file. I'd prefer not to do the "update file" as now I'm mucking with blobs, but even when I did try it, I was still unable to get the ID of the destination.
Thanks in advance for any further suggestions. I know I'm close and this could very well be a very repeatable scnerio for customers - moving (copying/deleting) a file from a source SharePoint to a different library is a very common request I find.
Sean
Hi @swallbridge,
I realize this is a fairly old post and I imagine you've figured this out by now, but I ran across the thread when I was looking for something else, so I thought I'd pass along what I've done in your scenario.
In your most recent screenshot, where you're looking for the Id to enter in the Update File Properties action, but it's not available in the Dynamic Content, try this: In the Expression builder, enter (by typing)
body('Copy_file_-_pending_to_archives_library')?['ItemId']
The key being that I think it's ItemId you want, but you have to enter an expression to get at it.
- Sandy
Proud to be a Flownaut!
Thanks for sharing Sandy. I had parked this as I had a decent workaround (but not a great one). I’m on vacation but will revisit this next week. Thanks for taking the time to share.
It looks like the action "Get file metadata using path" works great for this situation. Immediately following the copy, you can reach out to your new file, and pull in the ID. Perhaps this action was not around back when this thread was started.
Hello, @swallbridge!
Thank you for posting on the Flow Community Forum! Have you had an opportunity to apply @martinav‘s recommendation to adapt your Flow? If yes, and you find that solution to be satisfactory, please go ahead and click “Accept as Solution” so that this thread will be marked for other users to easily identify!
Thank you for being an active member of the Flow Community!
-Gabriel
Flow Community Manager
I have recently learned that the Copy File action itself now returns the DESTINATION file ID if you do a Get File Metadata first. That makes this a non-issue now as well. You have two options.
Hello, @swallbridge!
Thank you for posting on the Flow Community Forum! Have you had an opportunity to apply @martinav‘s recommendation to adapt your Flow? If yes, and you find that solution to be satisfactory, please go ahead and click “Accept as Solution” so that this thread will be marked for other users to easily identify!
Thank you for being an active member of the Flow Community!
-Gabriel
Flow Community Manager
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 |
---|---|
69 | |
21 | |
18 | |
17 | |
13 |
User | Count |
---|---|
124 | |
37 | |
29 | |
28 | |
26 |