Power Automate Exchange

Please login or click SIGN UP FOR FREE to create your FlowUG account to join this user group.
  • 1.  Move existing file using variables for path and filename

    Posted Sep 17, 2021 04:01 PM
    Hello, I have a flow that needs to move a file that exists in a SharePoint library.  Since the file already exists I need to access the file using a variable for the filename.  The variable is in fact capturing the filename accurately, however the path to the file is not being recognized thus erroring out in a Failed to verify the existence of source object error.  If I replace the variables for the path and filename with a direct link to the file then it works without issue.  The problem with that is, that each run of the flow will be picking a different file.  The screen shots below are just the tiles that are part of the Move File, there are many other tiles that work without issue in this flow.

    Create Parent Project Folder tile


    Set Parent Folder variable tile - Replace Expression - replace(outputs('Create_Parent_Project_Folder')?['body/{FullPath}'], 'Shared Documents/', '')

    Compose tile for destination folder, Full Path is linking to the Create Parent Project Folder tile

    Move File Tile

    Raw Inputs of Move File
    {
        "host": {
            "connectionReferenceName": "shared_sharepointonline",
            "operationId": "MoveFileAsync"
        },
        "parameters": {
            "dataset": "https://xxx.xxx.com/sites/SharePointTeam",
            "parameters/sourceFileId": "/Shared Documents/Project Documents/P500000 - Lance Day - Testing/Lance Day - Testing.docx",
            "parameters/destinationDataset": "https://xxx.xxx.com/sites/SharePointTeam",
            "parameters/destinationFolderPath": "Shared Documents/Project Documents/P500000 - Lance Day - Testing",
            "parameters/nameConflictBehavior": 1
        }
    }
    Raw Output (Body only) of Move File Tile, the source path is only partially underlined, this is my issue, and have no clue why.
        "body": {
            "status"400,
            "message""Failed to verify the existence of source object at 'https://xxx.xxx.com/sites/SharePointTeam/Shared Documents/Project Documents/P500000 - Lance Day - Testing/Lance Day - Testing.docx' due to error 'The system cannot find the file specified. (Exception from HRESULT: 0x80070002)'.\r\nclientRequestId: e41b56dc-8c47-46c1-81b9-931a7bd71ccd\r\nserviceRequestId: e41b56dc-8c47-46c1-81b9-931a7bd71ccd"
        }
    }



    ------------------------------
    Lance Day
    James River Insurance Company
    PA
    ------------------------------


  • 2.  RE: Move existing file using variables for path and filename

    Top Contributor
    Posted Sep 20, 2021 07:39 AM
    I think the file to move is actually looking for the files GUID not the file path. trying inserting a step earlier in the process that's a get file or similar action, then if that works, you should be able to take the GUID from that output and put it in the move file.

    ------------------------------
    Sam Duval
    Data Quality Analyst
    Element Financial
    Indianapolis IN
    ------------------------------