Forum Discussion
Moving files with Power Apps/Automate
Hello users,
I need for my Sharepoint to create in Power App a way so a file it's moved automaticaly when a new is added.
To be more explicit:
1. I have a folder for Document. I add a new file with name "X" through Power Apps in that folder.
2. After some time I want to upload a new file (same name "X", new revision) through Power Apps, in the same folder, but I want that old "X" to be moved automaticaly in an "Archive" folder.
I managed to implement the upload, getting folder path etc, but I can't figure it out how I can tell the Power App which file to automaticaly select and move when a new one is added.
The process of adding and re-adding a new file is not at the same time.
Can anyone help me, at least telling me if it's possible to select in Power App a file that's already uploaded?
Thank You!
- Vivek JaggaCopper Contributor
- Rares1055Copper ContributorI don't really know how to do that. Can you elaborate please?
Rares1055 does that flow not work? Assume you don't have the run after set on Create? You can click Create File action ... and Configure Run after, and check the boxes so it runs even if it fails (no file to move). But not sure if that's your only issue here is when files don't exist it fails and won't create?
- Don't know how you are managing the upload, but if you are using a flow which I assume, you would start with a condition, checking for the filename by doing a get files action and utilizing the Odata filter then you can check the count of the returned items array. If it's not empty then you can move that file somewhere else, then proceede with your create file action.
- Rares1055Copper Contributor
That's my flow. Where is "Move file" should move the old file and after that creat the new one.
Can you help please?