diff --git a/FarmmapsKPI/KPIApplication.cs b/FarmmapsKPI/KPIApplication.cs index b9f7e69..6b1eec3 100644 --- a/FarmmapsKPI/KPIApplication.cs +++ b/FarmmapsKPI/KPIApplication.cs @@ -83,7 +83,7 @@ namespace FarmmapsKPI private async Task Process(List roots, KPIInput input, StreamWriter sw) { KPIOutput kpio; - KPIOutput kpioPrevious = null; + KPIOutput kpioPrevious = new KPIOutput(); //creates a new empty string downloadFolder = input.DownloadFolder; if (string.IsNullOrEmpty(downloadFolder)) { @@ -271,7 +271,7 @@ namespace FarmmapsKPI dataList = new List { }; kpio = JsonConvert.DeserializeObject(item.Data.ToString()); //Seems sometimes duplicate KPI items are returned. So check that here and only write if this kpio is different from previous - if (kpio != kpioPrevious) + if (kpio.id != kpioPrevious.id) { dataList.Add(kpio.parentName); dataList.Add(kpio.data.area); diff --git a/FarmmapsKPI/KPIInput.json b/FarmmapsKPI/KPIInput.json index 04b9b70..46eff35 100644 --- a/FarmmapsKPI/KPIInput.json +++ b/FarmmapsKPI/KPIInput.json @@ -90,7 +90,7 @@ "name": "Kunstmest strooien", "operationCode": "7", "product": "7360", - "quantity": "400", + "quantity": "200", "status": "3", "to": "2022-05-23T12:34:00", "unit": "kg/ha",