Can a Selector property be used with a Delete action in Appsheet API?

Can I use a Selector, in the same way its used for a Find action, but in a Delete action in the Appsheet API?

What is the best way to make a selection of rows to be deleted with the Delete action using the Appsheet API? Selector does not seem to work?

The same Properties object with the selector works fine in a Find action, but returns an error that no rows are selected when using a Delete action.

2 Likes

No, you cannot use a Selector in the same way with the Delete action in the AppSheet API as you do with the Find action.

:red_circle: Key Limitation

The AppSheet REST API does not support the Selector in Delete actions. While the Selector works perfectly in a Find action to retrieve rows that match a filter, the Delete action expects a direct list of keys (row IDs) to delete — not a selector expression.

:white_check_mark: How to Delete Multiple Rows via API

To delete multiple rows via the AppSheet API, follow these steps:

  1. Use a Find Action with Selector

Call the Find action first to retrieve all the keys (row identifiers) that match your conditions.

Example Request:

{

“Action”: “Find”,

“Properties”: {

“Selector”: “AND([Status] = "Inactive", [Category] = "Expired")”

},

“Rows”:

}

  1. Extract the Keys from the Find Response

From the result, get the list of row keys (usually the unique ID column values).

  1. Send a Delete Action with Row Keys

Use the Delete action, but pass the Rows array with only the Key values of each row you want to delete.

Example Request:

{

“Action”: “Delete”,

“Rows”: [

{ “Key”: “row_key_1” },

{ “Key”: “row_key_2” },

{ “Key”: “row_key_3” }

]

}

:bell: Note: Replace “Key” with the actual name of your key column if it differs.

Summary

Feature Supported in Find Supported in Delete

Selector :white_check_mark: Yes :cross_mark: No

Passing row keys :cross_mark: Not needed :white_check_mark: Required

:pushpin: Pro Tip

You can automate this with a script (e.g., in Apps Script or your backend system) that:

  1. Calls Find

  2. Parses the response

  3. Sends the Delete request using the returned keys.

Let me know if you’d like an example script for that flow.

hi @OMarciano

no, the Selector property is not supported with the Delete action in the AppSheet API — it only works with Find

the Delete action requires that you explicitly list the rows to delete by their keys

best way to delete multiple rows:

  1. first use a Find action with your Selector to get the list of keys you want to delete

  2. then use those keys in a Delete request — you need to send each row’s key in the Rows array

example:

{
“Action”: “Delete”,
“Rows”: [
{ “Key”: “row_key_1” },
{ “Key”: “row_key_2” }
]
}

unfortunately, you can’t use Selector directly inside the Delete action — it has to be a two-step process