monday_ruby 1.1.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.env +1 -1
- data/.rubocop.yml +2 -1
- data/CHANGELOG.md +14 -0
- data/CONTRIBUTING.md +104 -0
- data/README.md +146 -142
- data/docs/.vitepress/config.mjs +255 -0
- data/docs/.vitepress/theme/index.js +4 -0
- data/docs/.vitepress/theme/style.css +43 -0
- data/docs/README.md +80 -0
- data/docs/explanation/architecture.md +507 -0
- data/docs/explanation/best-practices/errors.md +478 -0
- data/docs/explanation/best-practices/performance.md +1084 -0
- data/docs/explanation/best-practices/rate-limiting.md +630 -0
- data/docs/explanation/best-practices/testing.md +820 -0
- data/docs/explanation/column-values.md +857 -0
- data/docs/explanation/design.md +795 -0
- data/docs/explanation/graphql.md +356 -0
- data/docs/explanation/migration/v1.md +808 -0
- data/docs/explanation/pagination.md +447 -0
- data/docs/guides/advanced/batch.md +1274 -0
- data/docs/guides/advanced/complex-queries.md +1114 -0
- data/docs/guides/advanced/errors.md +818 -0
- data/docs/guides/advanced/pagination.md +934 -0
- data/docs/guides/advanced/rate-limiting.md +981 -0
- data/docs/guides/authentication.md +286 -0
- data/docs/guides/boards/create.md +386 -0
- data/docs/guides/boards/delete.md +405 -0
- data/docs/guides/boards/duplicate.md +511 -0
- data/docs/guides/boards/query.md +530 -0
- data/docs/guides/boards/update.md +453 -0
- data/docs/guides/columns/create.md +452 -0
- data/docs/guides/columns/metadata.md +492 -0
- data/docs/guides/columns/query.md +455 -0
- data/docs/guides/columns/update-multiple.md +459 -0
- data/docs/guides/columns/update-values.md +509 -0
- data/docs/guides/files/add-to-column.md +40 -0
- data/docs/guides/files/add-to-update.md +37 -0
- data/docs/guides/files/clear-column.md +33 -0
- data/docs/guides/first-request.md +285 -0
- data/docs/guides/folders/manage.md +750 -0
- data/docs/guides/groups/items.md +626 -0
- data/docs/guides/groups/manage.md +501 -0
- data/docs/guides/installation.md +169 -0
- data/docs/guides/items/create.md +493 -0
- data/docs/guides/items/delete.md +514 -0
- data/docs/guides/items/query.md +605 -0
- data/docs/guides/items/subitems.md +483 -0
- data/docs/guides/items/update.md +699 -0
- data/docs/guides/updates/manage.md +619 -0
- data/docs/guides/use-cases/dashboard.md +1421 -0
- data/docs/guides/use-cases/import.md +1962 -0
- data/docs/guides/use-cases/task-management.md +1381 -0
- data/docs/guides/workspaces/manage.md +502 -0
- data/docs/index.md +69 -0
- data/docs/package-lock.json +2468 -0
- data/docs/package.json +13 -0
- data/docs/reference/client.md +540 -0
- data/docs/reference/configuration.md +586 -0
- data/docs/reference/errors.md +693 -0
- data/docs/reference/resources/account.md +208 -0
- data/docs/reference/resources/activity-log.md +369 -0
- data/docs/reference/resources/board-view.md +359 -0
- data/docs/reference/resources/board.md +393 -0
- data/docs/reference/resources/column.md +543 -0
- data/docs/reference/resources/file.md +236 -0
- data/docs/reference/resources/folder.md +386 -0
- data/docs/reference/resources/group.md +507 -0
- data/docs/reference/resources/item.md +348 -0
- data/docs/reference/resources/subitem.md +267 -0
- data/docs/reference/resources/update.md +259 -0
- data/docs/reference/resources/workspace.md +213 -0
- data/docs/reference/response.md +560 -0
- data/docs/tutorial/first-integration.md +713 -0
- data/lib/monday/client.rb +24 -0
- data/lib/monday/configuration.rb +5 -0
- data/lib/monday/request.rb +15 -0
- data/lib/monday/resources/base.rb +4 -0
- data/lib/monday/resources/file.rb +56 -0
- data/lib/monday/util.rb +1 -0
- data/lib/monday/version.rb +1 -1
- metadata +87 -4
|
@@ -0,0 +1,509 @@
|
|
|
1
|
+
# Update Column Values
|
|
2
|
+
|
|
3
|
+
Set and update column values for items on your boards.
|
|
4
|
+
|
|
5
|
+
## Finding Column IDs
|
|
6
|
+
|
|
7
|
+
::: warning <span style="display: inline-flex; align-items: center; gap: 6px;"><svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z"></path><line x1="12" y1="9" x2="12" y2="13"></line><line x1="12" y1="17" x2="12.01" y2="17"></line></svg>Column IDs are Board-Specific</span>
|
|
8
|
+
**Before updating column values, you must find your board's actual column IDs.** See the [Items Create guide](/guides/items/create#finding-column-ids) for how to query column IDs.
|
|
9
|
+
:::
|
|
10
|
+
|
|
11
|
+
## Update Simple Column Value
|
|
12
|
+
|
|
13
|
+
For simple column types (text, numbers), use `change_simple_value`:
|
|
14
|
+
|
|
15
|
+
```ruby
|
|
16
|
+
require "monday_ruby"
|
|
17
|
+
|
|
18
|
+
Monday.configure do |config|
|
|
19
|
+
config.token = ENV["MONDAY_TOKEN"]
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
client = Monday::Client.new
|
|
23
|
+
|
|
24
|
+
# ⚠️ Replace with your actual column ID
|
|
25
|
+
response = client.column.change_simple_value(
|
|
26
|
+
args: {
|
|
27
|
+
board_id: 1234567890,
|
|
28
|
+
item_id: 987654321,
|
|
29
|
+
column_id: "text", # Your text column ID
|
|
30
|
+
value: "Updated text content"
|
|
31
|
+
}
|
|
32
|
+
)
|
|
33
|
+
|
|
34
|
+
if response.success?
|
|
35
|
+
item = response.body.dig("data", "change_simple_column_value")
|
|
36
|
+
puts "✓ Updated: #{item['name']}"
|
|
37
|
+
else
|
|
38
|
+
puts "✗ Failed to update column"
|
|
39
|
+
end
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
**Output:**
|
|
43
|
+
```
|
|
44
|
+
✓ Updated: Marketing Campaign
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Update Complex Column Value
|
|
48
|
+
|
|
49
|
+
For complex types (status, people, date), use `change_value` with JSON:
|
|
50
|
+
|
|
51
|
+
```ruby
|
|
52
|
+
require "json"
|
|
53
|
+
|
|
54
|
+
# ⚠️ Replace with your actual column ID
|
|
55
|
+
response = client.column.change_value(
|
|
56
|
+
args: {
|
|
57
|
+
board_id: 1234567890,
|
|
58
|
+
item_id: 987654321,
|
|
59
|
+
column_id: "status", # Your status column ID
|
|
60
|
+
value: JSON.generate({ label: "Done" })
|
|
61
|
+
}
|
|
62
|
+
)
|
|
63
|
+
|
|
64
|
+
if response.success?
|
|
65
|
+
item = response.body.dig("data", "change_column_value")
|
|
66
|
+
puts "✓ Status updated for: #{item['name']}"
|
|
67
|
+
end
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
## Update Different Column Types
|
|
71
|
+
|
|
72
|
+
### Text Column
|
|
73
|
+
|
|
74
|
+
```ruby
|
|
75
|
+
response = client.column.change_simple_value(
|
|
76
|
+
args: {
|
|
77
|
+
board_id: 1234567890,
|
|
78
|
+
item_id: 987654321,
|
|
79
|
+
column_id: "text", # ⚠️ Your text column ID
|
|
80
|
+
value: "Project description here"
|
|
81
|
+
}
|
|
82
|
+
)
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
### Numbers Column
|
|
86
|
+
|
|
87
|
+
```ruby
|
|
88
|
+
response = client.column.change_simple_value(
|
|
89
|
+
args: {
|
|
90
|
+
board_id: 1234567890,
|
|
91
|
+
item_id: 987654321,
|
|
92
|
+
column_id: "numbers", # ⚠️ Your numbers column ID
|
|
93
|
+
value: "12500" # Pass as string
|
|
94
|
+
}
|
|
95
|
+
)
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
### Status Column
|
|
99
|
+
|
|
100
|
+
```ruby
|
|
101
|
+
value = JSON.generate({ label: "Working on it" })
|
|
102
|
+
|
|
103
|
+
response = client.column.change_value(
|
|
104
|
+
args: {
|
|
105
|
+
board_id: 1234567890,
|
|
106
|
+
item_id: 987654321,
|
|
107
|
+
column_id: "status", # ⚠️ Your status column ID
|
|
108
|
+
value: value
|
|
109
|
+
}
|
|
110
|
+
)
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
### Date Column
|
|
114
|
+
|
|
115
|
+
```ruby
|
|
116
|
+
# Date only
|
|
117
|
+
value = JSON.generate({ date: "2024-12-31" })
|
|
118
|
+
|
|
119
|
+
response = client.column.change_value(
|
|
120
|
+
args: {
|
|
121
|
+
board_id: 1234567890,
|
|
122
|
+
item_id: 987654321,
|
|
123
|
+
column_id: "date4", # ⚠️ Your date column ID
|
|
124
|
+
value: value
|
|
125
|
+
}
|
|
126
|
+
)
|
|
127
|
+
|
|
128
|
+
# Date with time
|
|
129
|
+
value = JSON.generate({
|
|
130
|
+
date: "2024-12-31",
|
|
131
|
+
time: "14:30:00"
|
|
132
|
+
})
|
|
133
|
+
|
|
134
|
+
response = client.column.change_value(
|
|
135
|
+
args: {
|
|
136
|
+
board_id: 1234567890,
|
|
137
|
+
item_id: 987654321,
|
|
138
|
+
column_id: "date4",
|
|
139
|
+
value: value
|
|
140
|
+
}
|
|
141
|
+
)
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
### People Column
|
|
145
|
+
|
|
146
|
+
```ruby
|
|
147
|
+
# Single person
|
|
148
|
+
value = JSON.generate({
|
|
149
|
+
personsAndTeams: [
|
|
150
|
+
{ id: 12345678, kind: "person" } # Replace with actual user ID
|
|
151
|
+
]
|
|
152
|
+
})
|
|
153
|
+
|
|
154
|
+
response = client.column.change_value(
|
|
155
|
+
args: {
|
|
156
|
+
board_id: 1234567890,
|
|
157
|
+
item_id: 987654321,
|
|
158
|
+
column_id: "people", # ⚠️ Your people column ID
|
|
159
|
+
value: value
|
|
160
|
+
}
|
|
161
|
+
)
|
|
162
|
+
|
|
163
|
+
# Multiple people
|
|
164
|
+
value = JSON.generate({
|
|
165
|
+
personsAndTeams: [
|
|
166
|
+
{ id: 12345678, kind: "person" },
|
|
167
|
+
{ id: 87654321, kind: "person" }
|
|
168
|
+
]
|
|
169
|
+
})
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
### Timeline Column
|
|
173
|
+
|
|
174
|
+
```ruby
|
|
175
|
+
value = JSON.generate({
|
|
176
|
+
from: "2024-01-01",
|
|
177
|
+
to: "2024-03-31"
|
|
178
|
+
})
|
|
179
|
+
|
|
180
|
+
response = client.column.change_value(
|
|
181
|
+
args: {
|
|
182
|
+
board_id: 1234567890,
|
|
183
|
+
item_id: 987654321,
|
|
184
|
+
column_id: "timeline", # ⚠️ Your timeline column ID
|
|
185
|
+
value: value
|
|
186
|
+
}
|
|
187
|
+
)
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
### Dropdown Column
|
|
191
|
+
|
|
192
|
+
```ruby
|
|
193
|
+
value = JSON.generate({ labels: [123] }) # Label ID from column settings
|
|
194
|
+
|
|
195
|
+
response = client.column.change_value(
|
|
196
|
+
args: {
|
|
197
|
+
board_id: 1234567890,
|
|
198
|
+
item_id: 987654321,
|
|
199
|
+
column_id: "dropdown", # ⚠️ Your dropdown column ID
|
|
200
|
+
value: value
|
|
201
|
+
}
|
|
202
|
+
)
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
### Link Column
|
|
206
|
+
|
|
207
|
+
```ruby
|
|
208
|
+
value = JSON.generate({
|
|
209
|
+
url: "https://example.com",
|
|
210
|
+
text: "Example Website"
|
|
211
|
+
})
|
|
212
|
+
|
|
213
|
+
response = client.column.change_value(
|
|
214
|
+
args: {
|
|
215
|
+
board_id: 1234567890,
|
|
216
|
+
item_id: 987654321,
|
|
217
|
+
column_id: "link", # ⚠️ Your link column ID
|
|
218
|
+
value: value
|
|
219
|
+
}
|
|
220
|
+
)
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
### Email Column
|
|
224
|
+
|
|
225
|
+
```ruby
|
|
226
|
+
value = JSON.generate({
|
|
227
|
+
email: "user@example.com",
|
|
228
|
+
text: "Contact Email"
|
|
229
|
+
})
|
|
230
|
+
|
|
231
|
+
response = client.column.change_value(
|
|
232
|
+
args: {
|
|
233
|
+
board_id: 1234567890,
|
|
234
|
+
item_id: 987654321,
|
|
235
|
+
column_id: "email", # ⚠️ Your email column ID
|
|
236
|
+
value: value
|
|
237
|
+
}
|
|
238
|
+
)
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
### Phone Column
|
|
242
|
+
|
|
243
|
+
```ruby
|
|
244
|
+
value = JSON.generate({
|
|
245
|
+
phone: "+1-555-123-4567",
|
|
246
|
+
countryShortName: "US"
|
|
247
|
+
})
|
|
248
|
+
|
|
249
|
+
response = client.column.change_value(
|
|
250
|
+
args: {
|
|
251
|
+
board_id: 1234567890,
|
|
252
|
+
item_id: 987654321,
|
|
253
|
+
column_id: "phone", # ⚠️ Your phone column ID
|
|
254
|
+
value: value
|
|
255
|
+
}
|
|
256
|
+
)
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
### Checkbox Column
|
|
260
|
+
|
|
261
|
+
```ruby
|
|
262
|
+
value = JSON.generate({ checked: "true" })
|
|
263
|
+
|
|
264
|
+
response = client.column.change_value(
|
|
265
|
+
args: {
|
|
266
|
+
board_id: 1234567890,
|
|
267
|
+
item_id: 987654321,
|
|
268
|
+
column_id: "checkbox", # ⚠️ Your checkbox column ID
|
|
269
|
+
value: value
|
|
270
|
+
}
|
|
271
|
+
)
|
|
272
|
+
```
|
|
273
|
+
|
|
274
|
+
## Clear Column Value
|
|
275
|
+
|
|
276
|
+
Remove a column's value:
|
|
277
|
+
|
|
278
|
+
```ruby
|
|
279
|
+
response = client.column.change_value(
|
|
280
|
+
args: {
|
|
281
|
+
board_id: 1234567890,
|
|
282
|
+
item_id: 987654321,
|
|
283
|
+
column_id: "status", # ⚠️ Your column ID
|
|
284
|
+
value: JSON.generate({})
|
|
285
|
+
}
|
|
286
|
+
)
|
|
287
|
+
|
|
288
|
+
if response.success?
|
|
289
|
+
puts "✓ Column value cleared"
|
|
290
|
+
end
|
|
291
|
+
```
|
|
292
|
+
|
|
293
|
+
## Bulk Update Same Column
|
|
294
|
+
|
|
295
|
+
Update the same column for multiple items:
|
|
296
|
+
|
|
297
|
+
```ruby
|
|
298
|
+
def bulk_update_status(client, board_id, item_ids, status_label, column_id)
|
|
299
|
+
updated_count = 0
|
|
300
|
+
|
|
301
|
+
item_ids.each do |item_id|
|
|
302
|
+
response = client.column.change_value(
|
|
303
|
+
args: {
|
|
304
|
+
board_id: board_id,
|
|
305
|
+
item_id: item_id,
|
|
306
|
+
column_id: column_id,
|
|
307
|
+
value: JSON.generate({ label: status_label })
|
|
308
|
+
}
|
|
309
|
+
)
|
|
310
|
+
|
|
311
|
+
if response.success?
|
|
312
|
+
updated_count += 1
|
|
313
|
+
puts "✓ Updated item #{item_id}"
|
|
314
|
+
else
|
|
315
|
+
puts "✗ Failed to update item #{item_id}"
|
|
316
|
+
end
|
|
317
|
+
|
|
318
|
+
sleep(0.3) # Rate limiting
|
|
319
|
+
end
|
|
320
|
+
|
|
321
|
+
updated_count
|
|
322
|
+
end
|
|
323
|
+
|
|
324
|
+
# Usage
|
|
325
|
+
item_ids = [987654321, 987654322, 987654323]
|
|
326
|
+
count = bulk_update_status(
|
|
327
|
+
client,
|
|
328
|
+
1234567890,
|
|
329
|
+
item_ids,
|
|
330
|
+
"Done",
|
|
331
|
+
"status" # ⚠️ Replace with your status column ID
|
|
332
|
+
)
|
|
333
|
+
|
|
334
|
+
puts "\n✓ Updated #{count} items"
|
|
335
|
+
```
|
|
336
|
+
|
|
337
|
+
## Get Updated Item Details
|
|
338
|
+
|
|
339
|
+
Retrieve updated item information:
|
|
340
|
+
|
|
341
|
+
```ruby
|
|
342
|
+
response = client.column.change_value(
|
|
343
|
+
args: {
|
|
344
|
+
board_id: 1234567890,
|
|
345
|
+
item_id: 987654321,
|
|
346
|
+
column_id: "status", # ⚠️ Your column ID
|
|
347
|
+
value: JSON.generate({ label: "Done" })
|
|
348
|
+
},
|
|
349
|
+
select: [
|
|
350
|
+
"id",
|
|
351
|
+
"name",
|
|
352
|
+
"state",
|
|
353
|
+
{
|
|
354
|
+
column_values: ["id", "text", "type"]
|
|
355
|
+
}
|
|
356
|
+
]
|
|
357
|
+
)
|
|
358
|
+
|
|
359
|
+
if response.success?
|
|
360
|
+
item = response.body.dig("data", "change_column_value")
|
|
361
|
+
|
|
362
|
+
puts "Updated: #{item['name']}"
|
|
363
|
+
puts "Column Values:"
|
|
364
|
+
|
|
365
|
+
item["column_values"].each do |col_val|
|
|
366
|
+
next if col_val["text"].nil? || col_val["text"].empty?
|
|
367
|
+
puts " • #{col_val['id']}: #{col_val['text']}"
|
|
368
|
+
end
|
|
369
|
+
end
|
|
370
|
+
```
|
|
371
|
+
|
|
372
|
+
## Error Handling
|
|
373
|
+
|
|
374
|
+
Handle common update errors:
|
|
375
|
+
|
|
376
|
+
```ruby
|
|
377
|
+
def update_column_safe(client, board_id, item_id, column_id, value)
|
|
378
|
+
response = client.column.change_value(
|
|
379
|
+
args: {
|
|
380
|
+
board_id: board_id,
|
|
381
|
+
item_id: item_id,
|
|
382
|
+
column_id: column_id,
|
|
383
|
+
value: value
|
|
384
|
+
}
|
|
385
|
+
)
|
|
386
|
+
|
|
387
|
+
if response.success?
|
|
388
|
+
item = response.body.dig("data", "change_column_value")
|
|
389
|
+
puts "✓ Updated: #{item['name']}"
|
|
390
|
+
true
|
|
391
|
+
else
|
|
392
|
+
puts "✗ Failed to update column"
|
|
393
|
+
puts " Status: #{response.status}"
|
|
394
|
+
|
|
395
|
+
if response.body["errors"]
|
|
396
|
+
response.body["errors"].each do |error|
|
|
397
|
+
puts " Error: #{error['message']}"
|
|
398
|
+
end
|
|
399
|
+
end
|
|
400
|
+
|
|
401
|
+
false
|
|
402
|
+
end
|
|
403
|
+
rescue Monday::AuthorizationError
|
|
404
|
+
puts "✗ Invalid API token"
|
|
405
|
+
false
|
|
406
|
+
rescue Monday::InvalidRequestError => e
|
|
407
|
+
puts "✗ Invalid request: #{e.message}"
|
|
408
|
+
false
|
|
409
|
+
rescue Monday::Error => e
|
|
410
|
+
puts "✗ API error: #{e.message}"
|
|
411
|
+
false
|
|
412
|
+
end
|
|
413
|
+
|
|
414
|
+
# Usage
|
|
415
|
+
value = JSON.generate({ label: "Done" })
|
|
416
|
+
success = update_column_safe(
|
|
417
|
+
client,
|
|
418
|
+
1234567890,
|
|
419
|
+
987654321,
|
|
420
|
+
"status", # ⚠️ Your column ID
|
|
421
|
+
value
|
|
422
|
+
)
|
|
423
|
+
```
|
|
424
|
+
|
|
425
|
+
## Complete Example
|
|
426
|
+
|
|
427
|
+
Update various column types for an item:
|
|
428
|
+
|
|
429
|
+
```ruby
|
|
430
|
+
require "monday_ruby"
|
|
431
|
+
require "dotenv/load"
|
|
432
|
+
require "json"
|
|
433
|
+
|
|
434
|
+
Monday.configure do |config|
|
|
435
|
+
config.token = ENV["MONDAY_TOKEN"]
|
|
436
|
+
end
|
|
437
|
+
|
|
438
|
+
client = Monday::Client.new
|
|
439
|
+
|
|
440
|
+
board_id = 1234567890
|
|
441
|
+
item_id = 987654321
|
|
442
|
+
|
|
443
|
+
# IMPORTANT: Replace all column IDs with your board's actual column IDs
|
|
444
|
+
|
|
445
|
+
puts "\n📝 Updating Item Columns\n#{'=' * 50}\n"
|
|
446
|
+
|
|
447
|
+
# Update status
|
|
448
|
+
puts "Updating status..."
|
|
449
|
+
response = client.column.change_value(
|
|
450
|
+
args: {
|
|
451
|
+
board_id: board_id,
|
|
452
|
+
item_id: item_id,
|
|
453
|
+
column_id: "status", # ⚠️ Your status column ID
|
|
454
|
+
value: JSON.generate({ label: "Working on it" })
|
|
455
|
+
}
|
|
456
|
+
)
|
|
457
|
+
puts response.success? ? "✓ Status updated" : "✗ Failed"
|
|
458
|
+
|
|
459
|
+
# Update due date
|
|
460
|
+
puts "Updating due date..."
|
|
461
|
+
response = client.column.change_value(
|
|
462
|
+
args: {
|
|
463
|
+
board_id: board_id,
|
|
464
|
+
item_id: item_id,
|
|
465
|
+
column_id: "date4", # ⚠️ Your date column ID
|
|
466
|
+
value: JSON.generate({ date: "2024-12-31", time: "17:00:00" })
|
|
467
|
+
}
|
|
468
|
+
)
|
|
469
|
+
puts response.success? ? "✓ Due date updated" : "✗ Failed"
|
|
470
|
+
|
|
471
|
+
# Update owner
|
|
472
|
+
puts "Updating owner..."
|
|
473
|
+
response = client.column.change_value(
|
|
474
|
+
args: {
|
|
475
|
+
board_id: board_id,
|
|
476
|
+
item_id: item_id,
|
|
477
|
+
column_id: "people", # ⚠️ Your people column ID
|
|
478
|
+
value: JSON.generate({
|
|
479
|
+
personsAndTeams: [
|
|
480
|
+
{ id: 12345678, kind: "person" } # ⚠️ Replace with actual user ID
|
|
481
|
+
]
|
|
482
|
+
})
|
|
483
|
+
}
|
|
484
|
+
)
|
|
485
|
+
puts response.success? ? "✓ Owner updated" : "✗ Failed"
|
|
486
|
+
|
|
487
|
+
# Update text note
|
|
488
|
+
puts "Updating notes..."
|
|
489
|
+
response = client.column.change_simple_value(
|
|
490
|
+
args: {
|
|
491
|
+
board_id: board_id,
|
|
492
|
+
item_id: item_id,
|
|
493
|
+
column_id: "text", # ⚠️ Your text column ID
|
|
494
|
+
value: "High priority task - needs review"
|
|
495
|
+
}
|
|
496
|
+
)
|
|
497
|
+
puts response.success? ? "✓ Notes updated" : "✗ Failed"
|
|
498
|
+
|
|
499
|
+
puts "\n#{'=' * 50}"
|
|
500
|
+
puts "✓ Column updates complete"
|
|
501
|
+
puts "#{'=' * 50}"
|
|
502
|
+
```
|
|
503
|
+
|
|
504
|
+
## Next Steps
|
|
505
|
+
|
|
506
|
+
- [Update multiple column values](/guides/columns/update-multiple)
|
|
507
|
+
- [Query column values](/guides/columns/query)
|
|
508
|
+
- [Create columns](/guides/columns/create)
|
|
509
|
+
- [Update items](/guides/items/update)
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# Add File (Asset) to File Column
|
|
2
|
+
|
|
3
|
+
Add a file to a File Column.
|
|
4
|
+
|
|
5
|
+
```ruby
|
|
6
|
+
require "monday_ruby"
|
|
7
|
+
|
|
8
|
+
Monday.configure do |config|
|
|
9
|
+
config.token = ENV["MONDAY_TOKEN"]
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
client = Monday::Client.new
|
|
13
|
+
|
|
14
|
+
// UploadIO is from the multipart-post gem that is included.
|
|
15
|
+
response = client.file.add_file_to_column(
|
|
16
|
+
args: {
|
|
17
|
+
item_id: 123456789,
|
|
18
|
+
column_id: 'file_123xyz',
|
|
19
|
+
file: UploadIO.new(
|
|
20
|
+
File.open('./path/to/polarBear.jpg'),
|
|
21
|
+
'image/jpeg',
|
|
22
|
+
'polarBear.jpg'
|
|
23
|
+
)
|
|
24
|
+
}
|
|
25
|
+
)
|
|
26
|
+
|
|
27
|
+
if response.success?
|
|
28
|
+
monday_file_id = response.body.dig("data", "add_file_to_column", "id")
|
|
29
|
+
puts "✓ Added file #{monday_file_id} to column"
|
|
30
|
+
else
|
|
31
|
+
puts "✗ Failed to add file to column"
|
|
32
|
+
end
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
**Output:**
|
|
36
|
+
```
|
|
37
|
+
✓ Added file 11235683 to column
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# Add File (Asset) to Item Update (Comments)
|
|
2
|
+
|
|
3
|
+
Add a file to an Item Update.
|
|
4
|
+
|
|
5
|
+
```ruby
|
|
6
|
+
require "monday_ruby"
|
|
7
|
+
|
|
8
|
+
Monday.configure do |config|
|
|
9
|
+
config.token = ENV["MONDAY_TOKEN"]
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
client = Monday::Client.new
|
|
13
|
+
|
|
14
|
+
// UploadIO is from the multipart-post gem that is included.
|
|
15
|
+
response = client.file.add_file_to_update(
|
|
16
|
+
args: {
|
|
17
|
+
update_id: 987654321,
|
|
18
|
+
file: UploadIO.new(
|
|
19
|
+
File.open('./path/to/polarBear.jpg'),
|
|
20
|
+
'image/jpeg',
|
|
21
|
+
'polarBear.jpg'
|
|
22
|
+
)
|
|
23
|
+
}
|
|
24
|
+
)
|
|
25
|
+
|
|
26
|
+
if response.success?
|
|
27
|
+
monday_file_id = response.body.dig("data", "add_file_to_update", "id")
|
|
28
|
+
puts "✓ Added file #{monday_file_id} to Item's Update"
|
|
29
|
+
else
|
|
30
|
+
puts "✗ Failed to add file to Item's Update"
|
|
31
|
+
end
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
**Output:**
|
|
35
|
+
```
|
|
36
|
+
✓ Added file 11235683 to Item's Update
|
|
37
|
+
```
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# Clear column files
|
|
2
|
+
|
|
3
|
+
Clears all files in an item's File column. This is a helper method for files and you could also use the column.change_value to clear the column as well.
|
|
4
|
+
|
|
5
|
+
```ruby
|
|
6
|
+
require "monday_ruby"
|
|
7
|
+
|
|
8
|
+
Monday.configure do |config|
|
|
9
|
+
config.token = ENV["MONDAY_TOKEN"]
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
client = Monday::Client.new
|
|
13
|
+
|
|
14
|
+
// UploadIO is from the multipart-post gem that is included.
|
|
15
|
+
response = client.file.clear_file_column(
|
|
16
|
+
args: {
|
|
17
|
+
board_id: 123456789,
|
|
18
|
+
item_id: 789654321,
|
|
19
|
+
column_id: 'file_123xyz'
|
|
20
|
+
}
|
|
21
|
+
)
|
|
22
|
+
|
|
23
|
+
if response.success?
|
|
24
|
+
puts "✓ Column files cleared"
|
|
25
|
+
else
|
|
26
|
+
puts "✗ Failed to add file to Item's Update"
|
|
27
|
+
end
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
**Output:**
|
|
31
|
+
```
|
|
32
|
+
✓ Column files cleared
|
|
33
|
+
```
|