Forum Discussion

Brent_Reber's avatar
Brent_Reber
Frequent Visitor
6 months ago
Solved

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 tr...
  • deborshi_nag's avatar
    6 months ago

    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.csv
     
    You 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_Reber's avatar
    Brent_Reber
    6 months ago

    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.