# JavaScript API Issue when creating POST request

**URL:** <https://forum.kintone.dev/t/javascript-api-issue-when-creating-post-request/56>\
**Category:** General\
**Tags:** lookup-field\
**Created:** [October 30, 2017, 1:21am UTC](https://forum.kintone.dev/t/javascript-api-issue-when-creating-post-request/56 "2017-10-30T01:21:55Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![legacy\_user](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.kintone.dev/legacy_user/32/25_2.png) [@legacy\_user](https://forum.kintone.dev/u/legacy_user)\
**Post date:** [October 30, 2017, 1:21am UTC](https://forum.kintone.dev/t/javascript-api-issue-when-creating-post-request/56/1 "2017-10-30T01:21:55Z")

</div>

I have an issue when I make a JavaScript API POST request. I want to send data form Kintone App A to Kintone App B using the EVENT button on the detail page record.

## Code

This is the source code:

```javascript
kintone.api(kintone.api.url('/k/v1/record', true), 'POST', body, function (resp) {
  // success  
  console.log(resp);
}, function (error) {
  // error  
  console.log(error);
});

```

It works if I only sent a field outside [Table field](https://get.kintone.help/k/en/id/040529.html) (normal fields, lookup fields) and a table without [Lookup field](https://get.kintone.help/k/en/id/040526.html) inside.

But when I try to send a table with a lookup field inside, I always get the following error:

```json
{"code":"GAIA_LO03","id":"khYts2IzekEZXJqxu512","message":"Cannot retrieve data from the data source. The key field in the datasource app must be prohibited duplicate values."}

```

please show me if you can.

Thank you in advance!

---

<div class="post-metadata">

**Author:** ![legacy\_user](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.kintone.dev/legacy_user/32/25_2.png) [@legacy\_user](https://forum.kintone.dev/u/legacy_user)\
**Post date:** [October 30, 2017, 4:49am UTC](https://forum.kintone.dev/t/javascript-api-issue-when-creating-post-request/56/2 "2017-10-30T04:49:56Z")

</div>

I was able to solve this problem!

For those who have the same problem, please read the following articles:

- [Debug with Developer Tools - Kintone Developer Program](https://kintone.dev/en/tutorials/development-productivity/debug-with-developer-tools/)

- [What to Do If Adding/Updating Records in Bulk Failed - Kintone Help](https://get.kintone.help/k/en/id/040726.html)

The solution was to enable the "`Prohibit Duplicate Values`" option of the field used as the data's source.
