Copy Data activity - collection Reference checkbox.

Abhijit Shrikhande 382 Reputation points
2022-10-26T01:33:39.517+00:00

I am creating a copy data activity to copy the contents of a text file to a SQL server table.
The text file is in JSON format. Once I start the mapping, I noticed that I am able to select the section that is an array in the collectionReference text box. With this approach, I am able to write just 1 line from the array to the table, but I want all the lines to be written. Going through some examples I noticed that the author of these examples has clicked the checkbox specifying this is an array. Where is this checkbox and when does it get253949-collectionreferencecheckbox.png enabled?

This is a sample JSON file.

{  
	"PaymentRequest": {  
		"ID": "1234",  
		"URI": "https://somefactory.com/api/v3/invoice/1234",  
		"EmployeeName": "Rhaenys Targaryen",  
		"CurrencyCode": "USD",  
		"InvoiceNumber": 001,  
		"DataSource": "MAN",  
		"CountryCode": "US",  
		"Name": "Twenty Dollars",  
		"Description": "4 x 4 WOODEN LEGOS",  
		"PaymentTermsDays": 30,  
		"UserCreationDate": "2022-10-24 19:33:03.0",  
		"InvoiceDate": "2022-11-25 00:00:00.0",  
		"AssignedDate": "2022-10-24 19:33:04.0",  
		"InvoiceReceivedDate": "2022-09-26 00:00:00.0",  
		"PaymentStatus": "UNPAID",  
		"InvoiceAmount": 10.0,  
		"ShippingAmount": 0.0,  
		"TaxAmount": 0.0,  
		"DiscountPercentage": 0.0,  
		"VendorRemitAddress": {  
			"Address1": "300 Christo Ln",  
			"VendorCity": "Reading",  
			"VendorState": "CA",  
			"VendorPostalCode": 92620,  
			"VendorCountryCode": "US",  
			"VendorName": "Jamie Lannister",  
			"VendorCode": 7285  
		},  
		"LineItems": {  
			"LineItem": [  
				{  
					"LineItemId": "721b2a4c-dd55-4043-ab41-854b5308585a",  
					"ExpenseTypeCode": "UNDEFIN",  
					"RequestLineItemNumber": 1,  
					"Quantity": 2.0,  
					"Description": "Bulk Paper",  
					"UnitPrice": 10.0,  
					"TotalPrice": 20.0,  
					"RequestedLineItemAmount": 20.0,  
					"ApprovedLineItemAmount": 20.0  
				},  
				{  
					"LineItemId": "20b36387-b19a-4e3d-a0fd-13b280fab0d2",  
					"ExpenseTypeCode": "UNDEFIN",  
					"RequestLineItemNumber": 1,  
					"Quantity": 2.0,  
					"Description": "Bulk Paper",  
					"UnitPrice": 10.0,  
					"TotalPrice": 20.0,  
					"RequestedLineItemAmount": 20.0,  
					"ApprovedLineItemAmount": 20.0  
				}  
			]  
		}  
	}  
}  
Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
0 comments No comments
{count} votes

Answer accepted by question author
  1. Subashri Vasudevan 11,306 Reputation points Volunteer Moderator
    2022-10-26T05:36:16.377+00:00

    Hi @Abhijit Shrikhande

    Couple of things.

    1. You have already selected the array column in collection reference section in the top. No need to choose it in individual column.
    2. Regarding copying the first row , please check this video. It touches upon a simple solution to the issue, specifically after 4 min.

    Hope it helps. Let's know how it goes


0 additional answers

Sort by: Most helpful

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.