cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - You can subscribe to a forum, label or individual post and receive email notifications when someone posts a new topic or reply. Learn more! X

Deletedatatableentrieswithquery delete the entries from Datatable

Jamal8548
12-Amethyst

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

 

1 ACCEPTED SOLUTION

Accepted Solutions
Rocko
17-Peridot
(To:Jamal8548)

This works for me:

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

View solution in original post

4 REPLIES 4
Rocko
17-Peridot
(To:Jamal8548)

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": ...}

Jamal8548
12-Amethyst
(To:Rocko)

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"
    }
}

 

Rocko
17-Peridot
(To:Jamal8548)

This works for me:

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

Ah! actually i was running the query code directly in service Deletedatatableentrieswithquery as below in pic

 

Jamal8548_0-1716902259191.png

 

but creating a new service on Datatable thing and then executing it is working for me also. Thanks for test!

 

Top Tags