locked
How can I save a Variable into a JSON File? RRS feed

  • Question

  • Hi,

    I would like to save variables into a JSON file?

    Any ideas? I wonder if there is another way than the ones already proposed here:

    https://stackoverflow.com/questions/60673220/transfer-the-output-of-set-variable-activity-into-a-json-file-azure-data-fact

    Kind Regards,

    Alberto

    Wednesday, April 22, 2020 11:00 AM

All replies

  • Hi teslak,

    Thank you for your query. Yes, you can write a variable value to JSON file by utilizing  "Add additional columns during copy" feature as below. (NOTE: This feature works with the latest dataset model. If you don't see this option from the UI, try creating a new dataset.)

    Have a set variable activity and set the value of the variable, followed by a copy activity. In copy activity, Source settings, you have "Additional columns" property where you can give a name to source variable column. using Dynamic expression (@variables('varInput')) you assign the variable value. Then in Mapping section, you can remove unwanted columns and only have the required columns including variable column that you creating in "Additional columns". Then on the destination side give a column name. 










    Hope this helps. I will also add a GIF to the stackoverflow thread. Let me know if you have any questions. 

    Thank you

    If a post helps to resolve your issue, please click the "Mark as Answer" of that post and/or click Answered"Vote as helpful" button of that post. By marking a post as Answered and/or Helpful, you help others find the answer faster.


    Wednesday, April 22, 2020 10:55 PM
  • Hi there, 

    Just checking to see if the above information was helpful. If this answers your query, please do consider to click “Mark as Answer” and "Up-Vote" as it might be beneficial to other community members reading this thread. And, if you have any further query do let us know.

    Thank you

    If a post helps to resolve your issue, please click the "Mark as Answer" of that post and/or click Answered "Vote as helpful" button of that post. By marking a post as Answered and/or Helpful, you help others find the answer faster.

    Thursday, April 23, 2020 11:42 PM
  • Hi there, 

    Following up to see if the above information was helpful .

    Thank you

    If a post helps to resolve your issue, please click the "Mark as Answer" of that post and/or click Answered "Vote as helpful" button of that post. By marking a post as Answered and/or Helpful, you help others find the answer faster.

    Friday, April 24, 2020 11:18 PM