The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hello,
I have a JSON file with this structure from a CopyData activity step in my Data Factory pipeline:
"value": [{
"id": "123",
"isReadOnly": false,
//additional key-values
}, {
"id": "1234",
"isReadOnly": false,
//additional key-values
}, {
"id": "12345",
"isReadOnly": false,
//additional key-values
},
I want to extract all the 'ids' and turn them into an array so that I can iterate over them in a ForEach activity in Data Factory ex. ["123","1234","12345"]. How do I accomplish this?
I am very new to Data Factory so thank you for any other suggestions regarding using the ForEach to iterate over all the ids. As well, if you are able, the more detail the better. Thank you!
Solved! Go to Solution.
Hey,
The output Value is by default an Array.
You can iterate over the Copy activity output directly via For each and get the ID details per iteration itself.
where parameter Test value is :
[{ "id": "123", "isReadOnly": false }, { "id": "1234", "isReadOnly": false }]
You can use For each activity to iterate over the value directly
within for each, use Set variable activity to get the ID value
Output :
Hey,
The Parameter is just an example for demonstration purpose.
If the file size is less, you can use lookup activity to read the file and use that lokup value inplace of parameter
Hey,
The output Value is by default an Array.
You can iterate over the Copy activity output directly via For each and get the ID details per iteration itself.
where parameter Test value is :
[{ "id": "123", "isReadOnly": false }, { "id": "1234", "isReadOnly": false }]
You can use For each activity to iterate over the value directly
within for each, use Set variable activity to get the ID value
Output :
Thank you for answering my question, but how do I make the Default Value in the Parameters my Id key from my JSON file? In your example, it looks like the JSON file has been copy pasted into default value but since I'm creating a new JSON file everytime I run copy data, how would I make sure that that new JSON file is always used?