How to store an array in a json file in ADF

Mansi Yadav 60 Reputation points
2024-05-16T17:48:41.5333333+00:00

I have a web activity with url drive/drive-id/items/folder-id/children then I have a filter activity that filters all folders and then I'm appending it in an array. Now what I want is to store all folder ids in a json file. and later I will load that file using lookup activity and will iterate those folders and will download the files inside it. Please give me an approach. And all of this will be done in a loop so need to create new file every time

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

1 answer

Sort by: Most helpful
  1. Grace Guan 0 Reputation points Microsoft Employee
    2025-04-11T06:44:36.1866667+00:00

    Hi, @phemanth

    I have an array variable stored data like [{globalOfferId:"123",Reason:"xxx"}, ......]. How to convert it to an string?
    I have tried your sugesstion

    @json(variables('Results'))
    

    Error Mesage:
    Cannot fit array into the function parameter string.

    the message says, only can pass string to json not array.

    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.