Skip to main content
Jamal Ashraf
16-Pearl
May 16, 2024 10:51 AM UTC
Solved

Deletedatatableentrieswithquery delete the entries from Datatable

how can i delete the entries which are created before 30 january 2020. its giving me error 

 

 

Jamal8548_1-1715856626621.png

 

Rocko
RockoAnswer
19-Tanzanite
May 28, 2024 1:08 PM UTC

This works for me:

me.DeleteDataTableEntriesWithQuery({
query: {
 "filters": {
 "type": "LT",
 "fieldName": "d",
 "value": "2024-05-14T12:43:13.000Z" }
}
});

4 replies

Rocko
19-Tanzanite
May 16, 2024 11:42 AM UTC

You can't call Javascript functions in JSON. Try a date notation like this

2012-04-23T18:25:43.511Z

Also, I think there should be surrounding curly braces to make it an object.

{"filters": ...}

Translate
Jamal Ashraf
16-Pearl
May 28, 2024 11:45 AM UTC

Would you like to test on your end may be you can create few entries in datatable and try to delete it with Deletedatatableentrieswithquery service. the field qualityCheckTimestamp is of Datetime format. I have tried different ways and even if try 2012-04-23T18:25:43.511Z this format also but no it just does not work. I want to delete all the entries which are created before a specific date which i pass in query. 

 

{
 "filters": {
 "type": "LT",
 "fieldName": "qualityCheckTimeStamp",
 "value": "2024-03-12"
 }
}

 

Translate
Rocko
Rocko19-TanzaniteAnswer
19-Tanzanite
May 28, 2024 1:08 PM UTC

This works for me:

me.DeleteDataTableEntriesWithQuery({
query: {
 "filters": {
 "type": "LT",
 "fieldName": "d",
 "value": "2024-05-14T12:43:13.000Z" }
}
});
Translate