cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
New Member

On file properties modified, move file from one sharepoint library to another

I have found a few answers on simply moving a file from one library to another and it looks perfect. My issue is that it only works when a file is newly created. I need this to trigger when the file properties are modified (user is checking a box saying "yes, move this").

 

I've created this template from scratch and simply cannot get the copy to work:

 

Trigger: When a file is created or modified (properties Only)

Condition: When metadata field = true (this works right now)

Action: Copy File (this does not work)

Action/Site Address: https://thisismysite.com/sites/tds

Action/Source File Path: I have tried using [URL], [Link to File] and https://thisismysite.com/sites/tds/[Name]. Nothing works! [File Path] is not an option for me for some reason, it doesn't show up in my context menu, only [Folder Path] does.

Action/Destination File Path: https://thisismysite.com/sites/tds/subsite/doclibraryname/[Name]

 

I'm tearing my hair out here, please help!

 

 

 

6 REPLIES 6
Highlighted
Community Support
Community Support

Re: On file properties modified, move file from one sharepoint library to another

Hi @PSP,

 

Please switch the Copy file action to Create File Action.

See if that would make it work.

 

Regards,

Michael

Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Highlighted
Frequent Visitor

Re: On file properties modified, move file from one sharepoint library to another

Hi Michael, I've got this part working (the file copy using the Create New) but always need to do some string manipulations to extract the file extension and add this onto the new file. Is this normal?

 

Also, when using this method none of the file properties in the Sharepoint columns are recreated in the new file. I'm at a loss how to replicate the new file with the original files column values as none of the available actions seem to expose an ID to the newly created file.

Highlighted
Frequent Visitor

Re: On file properties modified, move file from one sharepoint library to another

Hi @v-micsh-msft, I've got this part working (the file copy using the Create New) but always need to do some string manipulations to extract the file extension and add this onto the new file. Is this norm

 

Also, when using this method none of the file properties in the Sharepoint columns are recreated in the new file. I'm at a loss how to replicate the new file with the original files column values as none of the available actions seem to expose an ID to the newly created file.

Highlighted
Advocate I
Advocate I

Re: On file properties modified, move file from one sharepoint library to another

Sorry to revive this thing, but I'm wondering what you did to get that file extension, I'm finding myself in the same boat here and can't seem to get it to work properly, when it copies the file to the new library, it does so without an extension.

Highlighted
Frequent Visitor

Re: On file properties modified, move file from one sharepoint library to another

@BigShotRob, like I said its a very contorted process.

Step 1 - find the last '.' before the file extension in the 'Identifier' property and store this as an integer variable 'intDot'

lastIndexOf(body('Get_file_properties')?['{Identifier}'],'.')
 
Step 2 - get the length of the 'Identifier' string and store this as another integer variable 'intLen'
length(body('Get_file_properties')?['{Identifier}'])
 
Step 3 - use the above variables to substring out the file extension and store this as string variable 'strFileExtn'
substring(body('Get_file_properties')?['{Identifier}'],variables('intDot'),sub(variables('intLen'),variables('intDot')))
 
Now you can concat the file name with the file extension.
 
Please, someone tell me there is an easier way!!
Highlighted
Advocate I
Advocate I

Re: On file properties modified, move file from one sharepoint library to another

@theBIMtractorthank you for your help - I can honestly say there's no way I would have figured this out. That being said, I'm going to give this a shot tomorrow to see if I can get it working.

 

"Please, someone tell me there is an easier way!!"

 

I cannot believe this is really how it's to be done, to think that THIS made it through Microsoft QA and they GA'd this connector when things like this can't do a simple copy document is absolutely mind blowing.

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

Tech Marathon

Maratón de Soluciones de Negocio Microsoft

Una semana de contenido con +100 sesiones educativas, consultorios, +10 workshops Premium, Hackaton, EXPO, Networking Hall y mucho más!

Top Solution Authors
Top Kudoed Authors
Users online (8,028)