Need Guidance: Does Glide delete API let us delete multiple rows?

Hi Guys,

I want to delete multiple rows using glide delete api. I have rows operated by " , "

I tried this in postman
here is my curl

curl --location 'https://api.glideapp.io/api/function/mutateTables' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer xxxxxxx' \
--data '{
  "appID": "kqFz2swaPf8zZ04eJFd7",
  "mutations": [
    {
      "kind": "delete-row",
      "tableName": "native-table-2FySqZjVhh1WMC0qUt68",
      "rowID": "HG94rmyhQJ2vfWlIPP4EAw,nOAl5BL.QCad3j2qNcWCgQ"
    }
  ]
}'

Somehow when I put two row ids separated by coma it does not work. Is it not allowed by glide?

Thank you in advance for your help

Regards,
Dilip

No, that is not supported. Each delete-row must be a distinct mutation.

1 Like

Hi @Darren_Murphy ,

Thank you for confirming it. I tried that and even the Delete by mutation.

I realised that it burns 1 update for every deletion that happened even via Delete Api for mutation.

It will burn through all my updates in no time.

Regards,
Dilip

Why do you want to use API to delete rows? You can delete multiple rows directly through a relation.

Hi @Hassan_Nadeem ,

Thank you for your reply. Yeah relation method finding duplicate and deleting would need user to click on button

But the api approach can be triggered automatically right.

Wanted a approach which would be scheduled so was thinking of api approach

Regards,
Dilip

Maybe you can use a code like this:

curl --location 'https://api.glideapp.io/api/function/mutateTables' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer xxxxxxx' \
--data '{
  "appID": "kqFz2swaPf8zZ04eJFd7",
  "mutations": [
    {
      "kind": "delete-row",
      "tableName": "native-table-2FySqZjVhh1WMC0qUt68",
      "rowID": "HG94rmyhQJ2vfWlIPP4EAw"
    }, {
      "kind": "delete-row",
      "tableName": "native-table-2FySqZjVhh1WMC0qUt68",
      "rowID": "nOAl5BL.QCad3j2qNcWCgQ"
    }
  ]
}'

Reminder that you can no longer use Glide’s table API to make requests to a table within the same app. You can make requests like this to edit tables in *other glide apps, or using a callback.

Yes you can. Where did you get that information from?

2 Likes

Hi @Javieri ,

Yeah tried this, The issue with this is delete mutations consider every delete as an update. If there are like 1000 rows then it just eats up your updates in like no time.

Regards,
Dilip