Gallery
DeleteRows
Share
Explore

icon picker
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!
Name
Date
What im working on
1
Ronnie Gross
10/21/2022
2
Matthew Smith
10/21/2022
3
Megan Smith
10/21/2022
4
Bradley Alexander
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.
Name
Symbol
Lat
Lng
1
Andorra
AD
42.546245
1.601554
2
United Arab Emirates
AE
23.424076
53.847818
3
Afghanistan
AF
33.93911
67.709953
4
Antigua and Barbuda
AG
17.060816
-61.796428
5
Anguilla
AI
18.220554
-63.068615
6
Albania
AL
41.153332
20.168331
7
Armenia
AM
40.069099
45.038189
8
Netherlands Antilles
AN
12.226079
-69.060087
9
Angola
AO
-11.202692
17.873887
10
Antarctica
AQ
-75.250973
-0.071389
11
Argentina
AR
-38.416097
-63.616672
12
American Samoa
AS
-14.270972
-170.132217
13
Austria
AT
47.516231
14.550072
14
Australia
AU
-25.274398
133.775136
15
Aruba
AW
12.52111
-69.968338
16
Azerbaijan
AZ
40.143105
47.576927
17
Bosnia and Herzegovina
BA
43.915886
17.679076
18
Barbados
BB
13.193887
-59.543198
19
Bangladesh
BD
23.684994
90.356331
20
Belgium
BE
50.503887
4.469936
21
Burkina Faso
BF
12.238333
-1.561593
22
Bulgaria
BG
42.733883
25.48583
23
Bahrain
BH
25.930414
50.637772
24
Burundi
BI
-3.373056
29.918886
25
Benin
BJ
9.30769
2.315834
26
Bermuda
BM
32.321384
-64.75737
27
Brunei
BN
4.535277
114.727669
28
Bolivia
BO
-16.290154
-63.588653
29
Brazil
BR
-14.235004
-51.92528
30
Bahamas
BS
25.03428
-77.39628
31
Bhutan
BT
27.514162
90.433601
32
Bouvet Island
BV
-54.423199
3.413194
33
Botswana
BW
-22.328474
24.684866
34
Belarus
BY
53.709807
27.953389
35
Belize
BZ
17.189877
-88.49765
36
Canada
CA
56.130366
-106.346771
37
Cocos [Keeling] Islands
CC
-12.164165
96.870956
38
Congo [DRC]
CD
-4.038333
21.758664
39
Central African Republic
CF
6.611111
20.939444
40
Congo [Republic]
CG
-0.228021
15.827659
41
Switzerland
CH
46.818188
8.227512
42
Côte d'Ivoire
CI
7.539989
-5.54708
43
Cook Islands
CK
-21.236736
-159.777671
44
Chile
CL
-35.675147
-71.542969
45
Cameroon
CM
7.369722
12.354722
46
China
CN
35.86166
104.195397
47
Colombia
CO
4.570868
-74.297333
48
Costa Rica
CR
9.748917
-83.753428
49
Cuba
CU
21.521757
-77.781167
50
Cape Verde
CV
16.002082
-24.013197
51
Christmas Island
CX
-10.447525
105.690449
52
Cyprus
CY
35.126413
33.429859
53
Czech Republic
CZ
49.817492
15.472962
54
Germany
DE
51.165691
10.451526
55
Djibouti
DJ
11.825138
42.590275
56
Denmark
DK
56.26392
9.501785
57
Dominica
DM
15.414999
-61.370976
58
Dominican Republic
DO
18.735693
-70.162651
59
Algeria
DZ
28.033886
1.659626
60
Ecuador
EC
-1.831239
-78.183406
61
Estonia
EE
58.595272
25.013607
62
Egypt
EG
26.820553
30.802498
63
Western Sahara
EH
24.215527
-12.885834
64
Eritrea
ER
15.179384
39.782334
65
Spain
ES
40.463667
-3.74922
66
Ethiopia
ET
9.145
40.489673
67
Finland
FI
61.92411
25.748151
68
Fiji
FJ
-16.578193
179.414413
69
Falkland Islands [Islas Malvinas]
FK
-51.796253
-59.523613
70
Micronesia
FM
7.425554
150.550812
71
Faroe Islands
FO
61.892635
-6.911806
72
France
FR
46.227638
2.213749
73
Gabon
GA
-0.803689
11.609444
74
United Kingdom
GB
55.378051
-3.435973
75
Grenada
GD
12.262776
-61.604171
76
Georgia
GE
42.315407
43.356892
77
French Guiana
GF
3.933889
-53.125782
78
Guernsey
GG
49.465691
-2.585278
79
Ghana
GH
7.946527
-1.023194
80
Gibraltar
GI
36.137741
-5.345374
81
Greenland
GL
71.706936
-42.604303
82
Gambia
GM
13.443182
-15.310139
83
Guinea
GN
9.945587
-9.696645
84
Guadeloupe
GP
16.995971
-62.067641
85
Equatorial Guinea
GQ
1.650801
10.267895
86
Greece
GR
39.074208
21.824312
87
South Georgia and the South Sandwich Islands
GS
-54.429579
-36.587909
88
Guatemala
GT
15.783471
-90.230759
89
Guam
GU
13.444304
144.793731
90
Guinea-Bissau
GW
11.803749
-15.180413
91
Guyana
GY
4.860416
-58.93018
92
Gaza Strip
GZ
31.354676
34.308825
93
Hong Kong
HK
22.396428
114.109497
94
Heard Island and McDonald Islands
HM
-53.08181
73.504158
95
Honduras
HN
15.199999
-86.241905
96
Croatia
HR
45.1
15.2
97
Haiti
HT
18.971187
-72.285215
98
Hungary
HU
47.162494
19.503304
99
Indonesia
ID
-0.789275
113.921327
100
Ireland
IE
53.41291
-8.24389
101
Israel
IL
31.046051
34.851612
102
Isle of Man
IM
54.236107
-4.548056
103
India
IN
20.593684
78.96288
104
British Indian Ocean Territory
IO
-6.343194
71.876519
105
Iraq
IQ
33.223191
43.679291
106
Iran
IR
32.427908
53.688046
107
Iceland
IS
64.963051
-19.020835
108
Italy
IT
41.87194
12.56738
109
Jersey
JE
49.214439
-2.13125
110
Jamaica
JM
18.109581
-77.297508
111
Jordan
JO
30.585164
36.238414
112
Japan
JP
36.204824
138.252924
113
Kenya
KE
-0.023559
37.906193
114
Kyrgyzstan
KG
41.20438
74.766098
115
Cambodia
KH
12.565679
104.990963
116
Kiribati
KI
-3.370417
-168.734039
117
Comoros
KM
-11.875001
43.872219
118
Saint Kitts and Nevis
KN
17.357822
-62.782998
119
North Korea
KP
40.339852
127.510093
120
South Korea
KR
35.907757
127.766922
121
Kuwait
KW
29.31166
47.481766
122
Cayman Islands
KY
19.513469
-80.566956
123
Kazakhstan
KZ
48.019573
66.923684
124
Laos
LA
19.85627
102.495496
125
Lebanon
LB
33.854721
35.862285
126
Saint Lucia
LC
13.909444
-60.978893
127
Liechtenstein
LI
47.166
9.555373
128
Sri Lanka
LK
7.873054
80.771797
129
Liberia
LR
6.428055
-9.429499
130
Lesotho
LS
-29.609988
28.233608
131
Lithuania
LT
55.169438
23.881275
132
Luxembourg
LU
49.815273
6.129583
133
Latvia
LV
56.879635
24.603189
134
Libya
LY
26.3351
17.228331
135
Morocco
MA
31.791702
-7.09262
136
Monaco
MC
43.750298
7.412841
137
Moldova
MD
47.411631
28.369885
138
Montenegro
ME
42.708678
19.37439
139
Madagascar
MG
-18.766947
46.869107
140
Marshall Islands
MH
7.131474
171.184478
141
Macedonia [FYROM]
MK
41.608635
21.745275
142
Mali
ML
17.570692
-3.996166
143
Myanmar [Burma]
MM
21.913965
95.956223
144
Mongolia
MN
46.862496
103.846656
145
Macau
MO
22.198745
113.543873
146
Northern Mariana Islands
MP
17.33083
145.38469
147
Martinique
MQ
14.641528
-61.024174
148
Mauritania
MR
21.00789
-10.940835
149
Montserrat
MS
16.742498
-62.187366
150
Malta
MT
35.937496
14.375416
151
Mauritius
MU
-20.348404
57.552152
152
Maldives
MV
3.202778
73.22068
153
Malawi
MW
-13.254308
34.301525
154
Mexico
MX
23.634501
-102.552784
155
Malaysia
MY
4.210484
101.975766
156
Mozambique
MZ
-18.665695
35.529562
157
Namibia
NA
-22.95764
18.49041
158
New Caledonia
NC
-20.904305
165.618042
159
Niger
NE
17.607789
8.081666
160
Norfolk Island
NF
-29.040835
167.954712
161
Nigeria
NG
9.081999
8.675277
162
Nicaragua
NI
12.865416
-85.207229
163
Netherlands
NL
52.132633
5.291266
164
Norway
NO
60.472024
8.468946
165
Nepal
NP
28.394857
84.124008
166
Nauru
NR
-0.522778
166.931503
167
Niue
NU
-19.054445
-169.867233
168
New Zealand
NZ
-40.900557
174.885971
169
Oman
OM
21.512583
55.923255
170
Panama
PA
8.537981
-80.782127
171
Peru
PE
-9.189967
-75.015152
172
French Polynesia
PF
-17.679742
-149.406843
173
Papua New Guinea
PG
-6.314993
143.95555
174
Philippines
PH
12.879721
121.774017
175
Pakistan
PK
30.375321
69.345116
176
Poland
PL
51.919438
19.145136
177
Saint Pierre and Miquelon
PM
46.941936
-56.27111
178
Pitcairn Islands
PN
-24.703615
-127.439308
179
Puerto Rico
PR
18.220833
-66.590149
180
Palestinian Territories
PS
31.952162
35.233154
181
Portugal
PT
39.399872
-8.224454
182
Palau
PW
7.51498
134.58252
183
Paraguay
PY
-23.442503
-58.443832
184
Qatar
QA
25.354826
51.183884
185
Réunion
RE
-21.115141
55.536384
186
Romania
RO
45.943161
24.96676
187
Serbia
RS
44.016521
21.005859
188
Russia
RU
61.52401
105.318756
189
Rwanda
RW
-1.940278
29.873888
190
Saudi Arabia
SA
23.885942
45.079162
191
Solomon Islands
SB
-9.64571
160.156194
192
Seychelles
SC
-4.679574
55.491977
193
Sudan
SD
12.862807
30.217636
194
Sweden
SE
60.128161
18.643501
195
Singapore
SG
1.352083
103.819836
196
Saint Helena
SH
-24.143474
-10.030696
197
Slovenia
SI
46.151241
14.995463
198
Svalbard and Jan Mayen
SJ
77.553604
23.670272
199
Slovakia
SK
48.669026
19.699024
200
Sierra Leone
SL
8.460555
-11.779889
201
San Marino
SM
43.94236
12.457777
202
Senegal
SN
14.497401
-14.452362
203
Somalia
SO
5.152149
46.199616
204
Suriname
SR
3.919305
-56.027783
205
São Tomé and Príncipe
ST
0.18636
6.613081
206
El Salvador
SV
13.794185
-88.89653
207
Syria
SY
34.802075
38.996815
208
Swaziland
SZ
-26.522503
31.465866
209
Turks and Caicos Islands
TC
21.694025
-71.797928
210
Chad
TD
15.454166
18.732207
211
French Southern Territories
TF
-49.280366
69.348557
212
Togo
TG
8.619543
0.824782
213
Thailand
TH
15.870032
100.992541
214
Tajikistan
TJ
38.861034
71.276093
215
Tokelau
TK
-8.967363
-171.855881
216
Timor-Leste
TL
-8.874217
125.727539
217
Turkmenistan
TM
38.969719
59.556278
218
Tunisia
TN
33.886917
9.537499
219
Tonga
TO
-21.178986
-175.198242
220
Turkey
TR
38.963745
35.243322
221
Trinidad and Tobago
TT
10.691803
-61.222503
222
Tuvalu
TV
-7.109535
177.64933
223
Taiwan
TW
23.69781
120.960515
224
Tanzania
TZ
-6.369028
34.888822
225
Ukraine
UA
48.379433
31.16558
226
Uganda
UG
1.373333
32.290275
227
U.S. Minor Outlying Islands
UM
228
United States
US
37.09024
-95.712891
229
Uruguay
UY
-32.522779
-55.765835
230
Uzbekistan
UZ
41.377491
64.585262
231
Vatican City
VA
41.902916
12.453389
232
Saint Vincent and the Grenadines
VC
12.984305
-61.287228
233
Venezuela
VE
6.42375
-66.58973
234
British Virgin Islands
VG
18.420695
-64.639968
235
U.S. Virgin Islands
VI
18.335765
-64.896335
236
Vietnam
VN
14.058324
108.277199
237
Vanuatu
VU
-15.376706
166.959158
238
Wallis and Futuna
WF
-13.768752
-177.156097
239
Samoa
WS
-13.759029
-172.104629
240
Kosovo
XK
42.602636
20.902977
241
Yemen
YE
15.552727
48.516388
242
Mayotte
YT
-12.8275
45.166244
243
South Africa
ZA
-30.559482
22.937506
244
Zambia
ZM
-13.133897
27.849332
245
Zimbabwe
ZW
-19.015438
29.154857
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
Flavor
Delete
1
Vanilla
Hate this flavor!
2
Carmel
Hate this flavor!
3
Cookies and Cream
Hate this flavor!
4
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
Name
Invoices
Total
Delete Invoices
1
Apple
Apple
Apple
$25,000.00
Delete 2 Invoices
2
Facebook
Facebook
Facebook
Facebook
Facebook
$79,750.00
Delete 4 Invoices
3
Google
Google
Google
$64,550.00
Delete 2 Invoices
There are no rows in this table
Invoices
Contract
Invoice Number
Amount
1
Apple
1
$10,000.00
2
Apple
2
$15,000.00
3
Facebook
3
$15,750.00
4
Facebook
4
$13,000.00
5
Facebook
5
$8,000.00
6
Facebook
6
$43,000.00
7
Google
7
$54,000.00
8
Google
8
$10,550.00
There are no rows in this table


Done
Delete the form submissions of someone trolling your form
Done
Archive old rows to speed up your document | Deleting rows that are 365 days old
Done

Share
 
Want to print your doc?
This is not the way.
Try clicking the ⋯ next to your doc name or using a keyboard shortcut (
CtrlP
) instead.