Azure Data Factory: how to get new file location from @triggerBody().folderPath without container name?

Viewed 1494

When creating storage event trigger, path to the file that triggered the event is found in @triggerBody().folderPath. However, the path also contains container name. I would like to set my dataflow input folder dynamically by using @triggerBody().folderPath in data flow wildcard paths option. This option has container name already set. How do I get the path to file without the container name?

1 Answers

1.Nagative to the Manage page and click the code button of your event trigger.

enter image description here

2.change the parameter code from

        "parameters": {
            "folderpath": "@triggerBody().folderPath"
        }

to

        "parameters": {
            "folderpath": "@substring(triggerBody().folderPath,add(indexof(triggerBody().folderPath,'/'),1),sub(length(triggerBody().folderPath),add(indexof(triggerBody().folderPath,'/'),1)))"
        }

Then you can just get the folder path in your parameter.

Related