Skip to content
DeleteRows
  • Pages
    • icon picker
      DeleteRows
    • coda_school
      The Coda School

DeleteRows

Formula: DeleteRows()
Category: Action
DeleteRows()
Deletes chosen rows
or stated otherwise...
Hey Coda, please delete the following row(s).

DeleteRows() has one parameter:
row (2).svg
Rows

DeleteRows(Rows)

A list of the rows to delete.


One of the largest drains on your doc’s performance are tables with high row counts (normally greater than 10,000 rows). Therefore, creating an automated system to delete old/unnecessary rows is a must.
Whether the above is your reason for deleting rows in your doc via an action or not, it is crucial to understand how to use this action. Let’s look at some common patterns you will be using with DeleteRows().

Deleting all rows from a table

Common in many distributed teams is the idea of a standup—a daily or weekly opportunity for individuals to share what they’re working on. Below is a button titled “Refresh Standup Table” that runs three actions:
Deletes all the rows from the table
Adds fresh new rows with a random assortment of people from the company
Without DeleteRows() this kind of workflow would not be possible! If you are interested, take a look at the button formula - Its a good one!
10/21/2022
10/21/2022
10/21/2022
10/21/2022
There are no rows in this table

Delete only a selection of table

Below is a large database of countries. In this scenario (as is common), the table below was downloaded from a website, but Bob, our astute researcher, only wants the rows where the country is below the equator and in the western hemisphere.
Bob has configured his button below to only delete a selection of his table - aka the countries with a + Lat and Lng value.
Andorra
AD
United Arab Emirates
AE
Afghanistan
AF
Antigua and Barbuda
AG
Anguilla
AI
Albania
AL
Armenia
AM
Netherlands Antilles
AN
Angola
AO
Antarctica
AQ
Argentina
AR
American Samoa
AS
Austria
AT
Australia
AU
Aruba
AW
Azerbaijan
AZ
Bosnia and Herzegovina
BA
Barbados
BB
Bangladesh
BD
Belgium
BE
Burkina Faso
BF
Bulgaria
BG
Bahrain
BH
Burundi
BI
Benin
BJ
Bermuda
BM
Brunei
BN
Bolivia
BO
Brazil
BR
Bahamas
BS
Bhutan
BT
Bouvet Island
BV
Botswana
BW
Belarus
BY
Belize
BZ
Canada
CA
Cocos [Keeling] Islands
CC
Congo [DRC]
CD
Central African Republic
CF
Congo [Republic]
CG
Switzerland
CH
Côte d'Ivoire
CI
Cook Islands
CK
Chile
CL
Cameroon
CM
China
CN
Colombia
CO
Costa Rica
CR
Cuba
CU
Cape Verde
CV
Christmas Island
CX
Cyprus
CY
Czech Republic
CZ
Germany
DE
Djibouti
DJ
Denmark
DK
Dominica
DM
Dominican Republic
DO
Algeria
DZ
Ecuador
EC
Estonia
EE
Egypt
EG
Western Sahara
EH
Eritrea
ER
Spain
ES
Ethiopia
ET
Finland
FI
Fiji
FJ
Falkland Islands [Islas Malvinas]
FK
Micronesia
FM
Faroe Islands
FO
France
FR
Gabon
GA
United Kingdom
GB
Grenada
GD
Georgia
GE
French Guiana
GF
Guernsey
GG
Ghana
GH
Gibraltar
GI
Greenland
GL
Gambia
GM
Guinea
GN
Guadeloupe
GP
Equatorial Guinea
GQ
Greece
GR
South Georgia and the South Sandwich Islands
GS
Guatemala
GT
Guam
GU
Guinea-Bissau
GW
Guyana
GY
Gaza Strip
GZ
Hong Kong
HK
Heard Island and McDonald Islands
HM
Honduras
HN
Croatia
HR
Haiti
HT
Hungary
HU
Indonesia
ID
Ireland
IE
Israel
IL
Isle of Man
IM
India
IN
British Indian Ocean Territory
IO
Iraq
IQ
Iran
IR
Iceland
IS
Italy
IT
Jersey
JE
Jamaica
JM
Jordan
JO
Japan
JP
Kenya
KE
Kyrgyzstan
KG
Cambodia
KH
Kiribati
KI
Comoros
KM
Saint Kitts and Nevis
KN
North Korea
KP
South Korea
KR
Kuwait
KW
Cayman Islands
KY
Kazakhstan
KZ
Laos
LA
Lebanon
LB
Saint Lucia
LC
Liechtenstein
LI
Sri Lanka
LK
Liberia
LR
Lesotho
LS
Lithuania
LT
Luxembourg
LU
Latvia
LV
Libya
LY
Morocco
MA
Monaco
MC
Moldova
MD
Montenegro
ME
Madagascar
MG
Marshall Islands
MH
Macedonia [FYROM]
MK
Mali
ML
Myanmar [Burma]
MM
Mongolia
MN
Macau
MO
Northern Mariana Islands
MP
Martinique
MQ
Mauritania
MR
Montserrat
MS
Malta
MT
Mauritius
MU
Maldives
MV
Malawi
MW
Mexico
MX
Malaysia
MY
Mozambique
MZ
Namibia
NA
New Caledonia
NC
Niger
NE
Norfolk Island
NF
Nigeria
NG
Nicaragua
NI
Netherlands
NL
Norway
NO
Nepal
NP
Nauru
NR
Niue
NU
New Zealand
NZ
Oman
OM
Panama
PA
Peru
PE
French Polynesia
PF
Papua New Guinea
PG
Philippines
PH
Pakistan
PK
Poland
PL
Saint Pierre and Miquelon
PM
Pitcairn Islands
PN
Puerto Rico
PR
Palestinian Territories
PS
Portugal
PT
Palau
PW
Paraguay
PY
Qatar
QA
Réunion
RE
Romania
RO
Serbia
RS
Russia
RU
Rwanda
RW
Saudi Arabia
SA
Solomon Islands
SB
Seychelles
SC
Sudan
SD
Sweden
SE
Singapore
SG
Saint Helena
SH
Slovenia
SI
Svalbard and Jan Mayen
SJ
Slovakia
SK
Sierra Leone
SL
San Marino
SM
Senegal
SN
Somalia
SO
Suriname
SR
São Tomé and Príncipe
ST
El Salvador
SV
Syria
SY
Swaziland
SZ
Turks and Caicos Islands
TC
Chad
TD
French Southern Territories
TF
Togo
TG
Thailand
TH
Tajikistan
TJ
Tokelau
TK
Timor-Leste
TL
Turkmenistan
TM
Tunisia
TN
Tonga
TO
Turkey
TR
Trinidad and Tobago
TT
Tuvalu
TV
Taiwan
TW
Tanzania
TZ
Ukraine
UA
Uganda
UG
U.S. Minor Outlying Islands
UM
United States
US
Uruguay
UY
Uzbekistan
UZ
Vatican City
VA
Saint Vincent and the Grenadines
VC
Venezuela
VE
British Virgin Islands
VG
U.S. Virgin Islands
VI
Vietnam
VN
Vanuatu
VU
Wallis and Futuna
WF
Samoa
WS
Kosovo
XK
Yemen
YE
Mayotte
YT
South Africa
ZA
Zambia
ZM
Zimbabwe
ZW
There are no rows in this table


Delete a single row from a table

Many times you may want to create a button that merely deletes a single row from a table —specifically the row from which the button was pressed.
Why? There are two main reasons:
You want to lock your doc to prevent accidental deletion of rows or rows in bulk, but you want people to still have that option via a button.
Your users are very tech illiterate and need the doc “dummy-proofed” so everything is as easy as possible.
Ice Cream Flavors
Vanilla
Hate this flavor!
Carmel
Hate this flavor!
Cookies and Cream
Hate this flavor!
Chocolate
Hate this flavor!
There are no rows in this table

Deleting a selection of rows from a separate table

One especially useful way to use DeleteRows() is when you configure a button in a column to delete an already filtered collection of rows that are related to that row. *NOTE: This can only be done with a formula-configuration of a button - not in the regular UI configuration*
Confused? Lets look at this example:
Contracts
Apple
Apple
Apple
$25,000.00
Delete 2 Invoices
Facebook
Facebook
Facebook
Facebook
Facebook
$79,750.00
Delete 4 Invoices
Google
Google
Google
$64,550.00
Delete 2 Invoices
There are no rows in this table
Invoices
1
2
3
4
5
6
7
8
There are no rows in this table



Want to print your doc?
This is not the way.
Try clicking the ··· in the right corner or using a keyboard shortcut (
CtrlP
) instead.