dynamic expression

arkiboys 9,706 Reputation points
2022-07-26T08:32:22.717+00:00

inside the ADF web activity Body, I have this sample json:

[
{
"id": "007"
"subject": "data/name",
"topic": null,
"eventType": "statusupdated",
"eventTime": "2022-07-26T10:01:00.9584103Z",
"data": {
"firstName": "farshad",
"company": "some"
},
"dataVersion": "1.0",
"metadataVersion": null
}
]

--------------------------

Question:
How is it possible to have dynamic expression inside this sample .json
for example, if I use the following inside the id, the expression does not error but it errors when I run the web activity:

[
{
"id": @{guid()}
"subject": "data/name",
"topic": null,
"eventType": "statusupdated",
"eventTime": "2022-07-26T10:01:00.9584103Z",
"data": {
"firstName": "somename",
"company": "some"
},
"dataVersion": "1.0",
"metadataVersion": null
}
]

Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
{count} votes

Answer accepted by question author
  1. AnnuKumari-MSFT 34,566 Reputation points Microsoft Employee Moderator
    2022-07-26T09:59:34.317+00:00

    Hi @arkiboys ,

    Thanks for using Microsoft Q&A platform and thanks for posting your question.

    As I understand , you are trying to run a web activity and passing the sample json as request body in the web activity. However, it's failing when you are passing the values dynamically. Please let me know if my understanding is incorrect.

    Could you please check if after "id": @{guid()} , is ',' missing in your json code as it looks.

    I tried to reproduce your scenario by calling a web activity to run another pipeline by passing the parameter value dynamically, it worked well for me. Kindly take a look at the image:

    224758-image.png

    224770-image.png

    Hope this will help. Please let us know if any further queries.

    ------------------------------

    • 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

1 additional answer

Sort by: Most helpful
  1. arkiboys 9,706 Reputation points
    2022-07-26T09:27:24.647+00:00

    can I not somehow add the dynamic expression inside the .json?

    0 comments No comments

Your answer

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