Use of variables within Post message body of a Copy Data Activity

Corey Amoruso 36 Reputation points
2021-02-15T18:28:05.403+00:00

I have a similar question to the post found here: https://learn.microsoft.com/en-us/answers/questions/157301/azure-data-factory-web-activity-body.html

My scenario is just slightly different as I am using a Copy Data activity connected to a Rest Data Set rather than the Web Activity itself. I have two variables that I would like to use in the Post message body but they do not seem to be getting translated properly. Is there a way to accomplish what I am trying to do here? According to that linked post, the syntax I am using should work.

Pipeline Variables:
68413-image.png

Message Body:
68366-image.png

Activity Output:
68355-image.png

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

Accepted answer
  1. HimanshuSinha-msft 19,486 Reputation points Microsoft Employee Moderator
    2021-02-15T21:19:12.907+00:00

    Hello @Corey Amoruso ,

    Thanks for the ask and using the Microsoft Q&A platform .

    The below expression should work out for you . The idea is to build the JSON using the concat function.

    @concat( '{  
    "UpdatedOn":',variables('LastRun'),  
    ',','MemberIDs":',variables('Memberids'),'}' )  
    

    I did tried this on a setvariable acitivity and it worked fine for me . Please see the animation below Please let me how it goes .

    68357-post-wa.gif

    Thanks
    Himanshu
    Please do consider to click on "Accept Answer" and "Up-vote" on the post that helps you, as it can be beneficial to other community members


0 additional answers

Sort by: Most helpful

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.