Forum Discussion
Get Metadata is falsely stating a file does not exist
I am running a pipeline based on the ADLS blob creation event.
The first item in the pipeline is the Get Metadata activity. I am using the FolderPath and FileName parameters from the trigger.
The Get Metadata activity consistently returns False for the Exists argument. The input for the Get Metadata activity contains the correct path and file name.
The file existed in that location at the time the pipeline ran.
I have previously included a Wait activity prior to the Get Metadata activity. I used various wait times between 1 minute and five minutes, but the results have all been the same. I also experienced a similiar issue with the Copy activity not finding the file while reporting the exact file path and file name from the trigger parameters before I added the Get Metadata and If Condition activities.
Hello Brent_Reber
You have a problem in the folder path. It is taking the container name "raw", which should be excluded. Your fully qualified folder is getting translated as
/raw/raw/enterprise/krisp/device_monitor/PHAC/PHAC_1_20260212161525.csvYou can use the code below to trim the "raw" from folderpath@{if(startswith(triggerBody().folderPath, 'raw/'),substring(triggerBody().folderPath, 4, sub(length(triggerBody().folderPath), 4)),triggerBody().folderPath)}The syntax for the solution is a little different than what you posted, but the structure of your suggestion is still intact. I used this syntax to make it work.
@{if(startswith(pipeline()?.TriggerEvent?.FolderPath,'raw'),substring(pipeline()?.TriggerEvent?.FolderPath,4,sub(length(pipeline()?.TriggerEvent?.FolderPath),4)),pipeline()?.TriggerEvent?.FolderPath)}Thank you for the quick response.
2 Replies
- deborshi_nag
Super User
Hello Brent_Reber
You have a problem in the folder path. It is taking the container name "raw", which should be excluded. Your fully qualified folder is getting translated as
/raw/raw/enterprise/krisp/device_monitor/PHAC/PHAC_1_20260212161525.csvYou can use the code below to trim the "raw" from folderpath@{if(startswith(triggerBody().folderPath, 'raw/'),substring(triggerBody().folderPath, 4, sub(length(triggerBody().folderPath), 4)),triggerBody().folderPath)}- Brent_ReberFrequent Visitor
The syntax for the solution is a little different than what you posted, but the structure of your suggestion is still intact. I used this syntax to make it work.
@{if(startswith(pipeline()?.TriggerEvent?.FolderPath,'raw'),substring(pipeline()?.TriggerEvent?.FolderPath,4,sub(length(pipeline()?.TriggerEvent?.FolderPath),4)),pipeline()?.TriggerEvent?.FolderPath)}Thank you for the quick response.