create a variable in the Data Factory

Michele Teixeira 1 Reputation point
2021-01-12T02:53:41.373+00:00

Hi,

I want to create a variable in the Data Factory that returns all the "CustomerID" of a json, below:
I've tried everything and I can't solve it.
Can you help me?

"Result": [
{
"CreatedDate": "/Date(1607828445483-0300)/",
"CustomerID": 787754,
"CustomerType": "P",
"DocumentNumber": "11882470770",
"Email": "xpto@Stuff .com",
"IntegrationID": null,
"Name": "Bruna",
"WebSiteID": 162
},
{
"CreatedDate": "/Date(1607828774663-0300)/",
"CustomerID": 787755,
"CustomerType": "P",
"DocumentNumber": "41811885829",
"Email": "michele.alves@Stuff .com",
"IntegrationID": null,
"Name": "Debora",
"WebSiteID": 157
},

Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
10,976 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. HarithaMaddi-MSFT 10,136 Reputation points
    2021-01-12T10:02:07.067+00:00

    Hi @Michele Teixeira ,

    Welcome to Microsoft Q&A Platform. Thanks for posting the query.

    This can be achieved by using foreach activity which can store all these customer ids into an array variable. Set variable activity can be used in addition to this to convert array into string as below.

    Foreach Config:

    55693-image.png

    Append variable inside Foreach:

    55694-image.png

    Set variable post Foreach to convert array into string:

    55610-image.png

    Please let us know for further queries and we will be glad to assist.

    --

    • Please accept an answer if correct. 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.
    1 person found this answer helpful.

  2. dgreat juan 1 Reputation point
    2021-02-11T00:32:35.063+00:00

    Based on my analysis the above solution is correct and can be accepted as the correct answer.

    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.