--- title: "Collection.SetUniqueFields - Web Scraping API - Mozenda" slug: "collectionsetuniquefields" description: "Setting unique fields allows you to avoid duplicates in your data set. Use Collection.SetUniqueFields to do this via the Mozenda API. " updated: 2024-05-14T14:22:42Z published: 2024-05-14T14:22:42Z canonical: "help.mozenda.com/collectionsetuniquefields" --- > ## Documentation Index > Fetch the complete documentation index at: https://help.mozenda.com/llms.txt > Use this file to discover all available pages before exploring further. # Collection.SetUniqueFields ### Description Sets the unique **fields** on the **collection**. ### URL parameters :::(Info) (URL parameter ordering) The **URL parameters** below are listed in the order they should be entered in the API **URL**. ::: | Name | Required | Type | Description | | -------------- | -------- | ------- | -------------------------------------------------------- | | `CollectionID` | True | numeric | Unique identifier of the **collection**. | | `Fields` | True | string | Comma-separated list of **field** names to be set as unique. | ### Responses | Name | Type | Description | | ----------------------- | ------- | ------------------------------------------ | | `Result` | string | `Success` if the operation was successful. | | `DuplicateItemsRemoved` | numeric | The number of duplicate **items** removed. | ### Sample Request ```bash curl -X GET 'https://api.mozenda.com/rest?WebServiceKey=XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&Service=Mozenda10&Operation=Collection.SetUniqueFields&CollectionID=1052&Fields=Col1,Col2,Col3' ``` ### Sample responses #### XML ```xml Success 0 ``` #### JSON (add `&ResponseFormat=JSON`) ```json { "DuplicateItemsRemoved": 0, "JsonResult": { "Command": "Collection.SetUniqueFields", "AutoLoggedIn": false, "WebConsoleKey": "", "Result": "Success", "ErrorCode": "", "ErrorDescription": "", "ErrorList": [], "ExecutionTime": { "Ticks": 0, "Days": 0, "Hours": 0, "Milliseconds": 0, "Minutes": 0, "Seconds": 0, "TotalDays": 0, "TotalHours": 0, "TotalMilliseconds": 0, "TotalMinutes": 0, "TotalSeconds": 0 } } } ```