Forum Discussion

wanwar's avatar
wanwar
Helper I
3 months ago
Solved

Lakehouse File name

Using an activator to trigger a pipeline based on a new file created in the Lakehouse, the pipeline accepts a paramter for filename, in the pipeline i have added the folder in the File path and for t...
  • v-anbandari's avatar
    3 months ago

    Hi wanwar ,
    Thank you for reaching out to the Microsoft Fabric Community.

    You can just take the file name from the trigger value by using this expression:

    @last(split(triggerBody()?['__source'], '/'))

    Here, triggerBody()?['__source'] gives the full path, then split breaks it using “/”, and last picks the final part which is the file name (like data.csv). Use this while passing the parameter to your pipeline so it only gets the file name.

    Please refer to this for more details:
    https://learn.microsoft.com/en-us/fabric/real-time-intelligence/data-activator/activator-trigger-model

    If you need any additional assistance, feel free to reach out to us.
    Thank You.