DataSet ImportJson Api


#1

Hi all,

It would be nice to have an extra parameter in the dataset importjson to delete existing dataset data.

Currently, correct me if I am wrong the, method seems to add and merge data?

Cheers


#2

Actually it is already possible, however we will need to try and update the documentation for that API call.

Per documentation the json you import has the uniqueKeys which a column name that must be the same in CMS dataSet and the json.
Then you have rows with actual data you want to import.

In a similiar fashion to uniqueKeys you can also have a truncate in your json that takes the value True or False (for deleting existing data before import and leaving it there respectively).

ie for example:

{
	"uniqueKeys": [
		"petName"
	],
	"truncate": [
		"True"
	],
	"rows": [{
			"petName": "name",
			"ownerName": "ownerName",
			"aptDate": "2018-11-21 08:30",
			"aptNotes": "notes"
		}
	]
}

That will always truncate the dataset table first before it imports the rows from json.


#3

Thanks so much! this saved me having extra calls to delete existing dataset data.

Cheers