Updated the primary input dataset for the specified wrangled dataset. Each wrangled dataset must have one and only one primary input dataset, which can be an imported or wrangled dataset.

Tip: In the UI, the WrangledDataset object is called a recipe.

This action performs a dataset swap for the source of a wrangled dataset, which can be done through the UI. See Flow View Page.

Tip: After you have created a job via API, you can use this API to swap out the source data for the job's dataset. In this manner, you can rapidly re-execute a pre-existing job using fresh data. See API JobGroups Create v4.

Version:  v4

Required Permissions

Request

Request Type: PUT

Endpoint:

/v4/wrangledDatasets/<id>/primaryInputDataset

where:

ParameterDescription
<id>Internal identifier for the wrangled dataset

Request URI - Example:

/v4/wrangledDatasets/14/primaryInputDataset

 

Request Body - imported dataset:

{
  "importedDataset": {
    "id": 9
  }
}

Request Body - wrangled dataset:

{
  "wrangledDataset": {
    "id": 13
  }
}

Response

Response Status Code - Success:  200 - OK

Response Body Example - imported dataset:

{
    "id": 14,
    "wrangled": true,
    "createdAt": "2019-02-13T18:39:32.754Z",
    "updatedAt": "2019-02-13T18:40:11.639Z",
    "recipe": {
        "id": 14,
        "name": "POS-r01",
        "description": null,
        "active": true,
        "nextPortId": 2,
        "createdAt": "2019-02-13T18:39:32.737Z",
        "updatedAt": "2019-02-13T18:40:11.638Z",
        "currentEdit": {
            "id": 18
        },
        "redoLeafEdit": {
            "id": 16
        },
        "creator": {
            "id": 1
        },
        "updater": {
            "id": 1
        }
    },
    "referenceInfo": null,
    "activeSample": {
        "id": 14
    },
    "creator": {
        "id": 1
    },
    "updater": {
        "id": 1
    },
    "referencedFlowNode": null,
    "flow": {
        "id": 3
    }
}

Response Body Example - wrangled dataset:

{
    "id": 14,
    "wrangled": true,
    "createdAt": "2019-02-13T18:39:32.754Z",
    "updatedAt": "2019-02-13T18:40:11.639Z",
    "recipe": {
        "id": 14,
        "name": "POS-r01",
        "description": null,
        "active": true,
        "nextPortId": 2,
        "createdAt": "2019-02-13T18:39:32.737Z",
        "updatedAt": "2019-02-13T18:40:11.638Z",
        "currentEdit": {
            "id": 18
        },
        "redoLeafEdit": {
            "id": 16
        },
        "creator": {
            "id": 1
        },
        "updater": {
            "id": 1
        }
    },
    "referenceInfo": null,
    "activeSample": {
        "id": 14
    },
    "creator": {
        "id": 1
    },
    "updater": {
        "id": 1
    },
    "referencedFlowNode": null,
    "flow": {
        "id": 3
    }
}

Reference

For more information on these properties, see API WrangledDatasets Get PrimaryInputDataset v4.