How to get activity name of Execute pipeline dynamically into the next activity in ADF?

Vijayvargiya, Divyank 6 Reputation points
2023-01-03T15:27:23.913+00:00

I urgently have a requirement to pass activity name of Execute Pipeline Activity dynamically into the next activity eg Copy Activity.

Data flow Diagram -- >

Execute pipeline Activity -- > Copy Activity
(name - Ex Act01)

I know "@pipeline().Pipeline" will give main pipeline name and "@activity('Ex Act01').output.pipelineName" will give its child pipeline name.

Is there any way I can get "Ex Act01" passed to copy activity dynamically, without Hardcoding it in ADF?

Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
11,624 questions
{count} vote

3 answers

Sort by: Most helpful
  1. Nandan Hegde 36,146 Reputation points MVP Volunteer Moderator
    2023-01-03T15:56:10.953+00:00

    Unfortunately based on my understanding, it is not possible to get the activity names dynamically in either adf Or synapse. It needs to be hardcoded only.
    @MartinJaffer-MSFT : can you please confirm on this?

    2 people found this answer helpful.
    0 comments No comments

  2. MartinJaffer-MSFT 26,236 Reputation points
    2023-01-04T18:44:40.297+00:00

    Hello @Vijayvargiya, Divyank ,
    Thanks for the question and using MS Q&A platform.

    As I understand, your ask, you want to get the name of an activity dynamically. There is something about this which confuses me, trying to understand use case.

    When you make your pipeline, and add in activities, you choose and hardcode the names of the activities. The names don't change unless you change them. The names are also used to identify the activity in expressions.

    Name the activity
    Reference the activity

    In order to get the activity properties (name is a property too), the pipeline expression needs to reference the activity. Since activities are referenced by name, circular logic doesn't let you get the name without knowing the name.

    You might ask, "Why can't I get the name of the previous activity?"
    Well, more than one activity can feed into a later activity. They can even be the same type, so there is no way to tell them apart without name.

    Multiple Input activity

    So, in short, @Nandan Hegde is correct. Hardcode it.

    Did I misunderstand your ask?

    Please do let me if you have any queries.

    Thanks
    Martin


    • Please don't forget to click on 130616-image.png or upvote 130671-image.png button whenever the information provided helps you. Original posters help the community find answers faster by identifying the correct answer. Here is how
    • Want a reminder to come back and check responses? Here is how to subscribe to a notification
      • If you are interested in joining the VM program and help shape the future of Q&A: Here is how you can be part of Q&A Volunteer Moderators
    2 people found this answer helpful.

  3. Nandan Hegde 36,146 Reputation points MVP Volunteer Moderator
    2025-03-25T04:37:57.5166667+00:00

    Hey Jörgen Hasselgren
    Good day!

    Unfortunately it is still not possible to directly pass the previous activities names dynamically. You have to pass it manually/hardcoded way

    1 person found this answer helpful.
    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.