Hello,
I'm trying to use Flow to delete a file in a folder, based on the contents of a spreadsheet.
The spreadsheet has a column called filename and the file is always in the same folder, but my flow always fails when attempting to delete the file.
- Flow reads the spreadsheet
- I then use the following expression in a Compose section to define the file path of the file to be deleted which refers to the attachment name.
- concat('/Presales Triage Store/MPS/',string(items('Apply_to_each')?['Attachment Name']))
- The flow should delete the file at the path above.
The output of the filepath is correct and says '/Presales Triage Store/MPS/automation test.docx' but I get the following error from MS Flow when trying to delete the file;
InvalidTemplate. Unable to process template language expressions in action 'Delete_file' inputs at line '1' and column '2687': 'The template language expression 'json(decodeBase64(triggerOutputs().headers['X-MS-APIM-Tokens']))['$connections']['shared_onedriveforbusiness']['connectionId']' cannot be evaluated because property 'shared_onedriveforbusiness' doesn't exist, available properties are 'shared_excelonlinebusiness, shared_office365'. Please see https://aka.ms/logicexpressions for usage details.'.
If I manually find the file using the explorer Flow will delete the file, but when using the above expression it fails. Does anyone know how to fix this?