# Bulk record update

**URL:** <https://forums.knack.com/t/bulk-record-update/10200>\
**Category:** API & Custom Code\
**Created:** [February 18, 2016, 2:07am UTC](https://forums.knack.com/t/bulk-record-update/10200 "2016-02-18T02:07:37Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![JoaoFernan59826](https://avatars.discourse-cdn.com/v4/letter/j/919ad9/32.png) [@JoaoFernan59826](https://forums.knack.com/u/JoaoFernan59826)\
**Post date:** [February 18, 2016, 2:07am UTC](https://forums.knack.com/t/bulk-record-update/10200/1 "2016-02-18T02:07:37Z")

</div>

Here I have a code to update ONE record:

```
$.ajax({
	url: "https://api.knackhq.com/v1/objects/object_1/records/" + record_id,
	type: "PUT",
	headers: my_headers,
	data: {
		field_1 : value_1,
		field_2 : value_2,
		field_3 : value_3
	},
	success: function(response) { 
		console.log("Done!");
	}
});
```

&nbsp;

But I have to update 700 records. Is there a way to make a bulk update with the fewest requests number possible? I mean, do more than one request per request.

---

<div class="post-metadata">

**Author:** ![undefinedu16608](https://avatars.discourse-cdn.com/v4/letter/u/9f8e36/32.png) [@undefinedu16608](https://forums.knack.com/u/undefinedu16608)\
**Post date:** [March 14, 2017, 3:37pm UTC](https://forums.knack.com/t/bulk-record-update/10200/2 "2017-03-14T15:37:31Z")

</div>

Hi, not sure if I understand correctly but believe what you need is a loop to iterate through all your records?, something like:

for (var i = 0; i \< data.total\_records; i++) {

data: {

field\_1 : value\_1, field\_2 : value\_2, field\_3 : value\_3

},

}

&nbsp;

or perhaps write a variable in the URL ... you need someone that can code JS/AJAX :)

---

<div class="post-metadata">

**Author:** ![EricMay88971](https://avatars.discourse-cdn.com/v4/letter/e/87869e/32.png) [@EricMay88971](https://forums.knack.com/u/EricMay88971)\
**Post date:** [March 11, 2016, 4:27pm UTC](https://forums.knack.com/t/bulk-record-update/10200/3 "2016-03-11T16:27:39Z")

</div>

Any chance you could post a simple example of the code you are referring to? Or a link to a tutorial for those of who are still learning 🙂  
  
Thanks!

---

<div class="post-metadata">

**Author:** ![undefinedu16608](https://avatars.discourse-cdn.com/v4/letter/u/9f8e36/32.png) [@undefinedu16608](https://forums.knack.com/u/undefinedu16608)\
**Post date:** [March 11, 2016, 3:07pm UTC](https://forums.knack.com/t/bulk-record-update/10200/4 "2016-03-11T15:07:26Z")

</div>

I normally use Tasks... you set a condition and execute... :)

---

<div class="post-metadata">

**Author:** ![EricMay88971](https://avatars.discourse-cdn.com/v4/letter/e/87869e/32.png) [@EricMay88971](https://forums.knack.com/u/EricMay88971)\
**Post date:** [March 11, 2016, 1:44am UTC](https://forums.knack.com/t/bulk-record-update/10200/5 "2016-03-11T01:44:13Z")

</div>

I have been trying to figure out a way to do bulk updates as well and am very interested if you were able to get this to work. Any progress?

---

<div class="post-metadata">

**Author:** ![BradStevens](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.knack.com/bradstevens/32/140_2.png) [@BradStevens](https://forums.knack.com/u/BradStevens)\
**Post date:** [February 20, 2016, 3:52am UTC](https://forums.knack.com/t/bulk-record-update/10200/6 "2016-02-20T03:52:54Z")

</div>

Can you do it with a filter?  
I.e. Use a filter to update all the records at once instead of one record at a time.

I haven’t tried it but it’d be worth seeing if it works, and here’s the filters help page for API [http://helpdesk.knackhq.com/support/solutions/articles/5000447623-filters-search](http://helpdesk.knackhq.com/support/solutions/articles/5000447623-filters-search)
