# POSTing a new record with a connection

**URL:** <https://forums.knack.com/t/posting-a-new-record-with-a-connection/10996>\
**Category:** Ask Developers\
**Created:** [August 30, 2021, 8:57pm UTC](https://forums.knack.com/t/posting-a-new-record-with-a-connection/10996 "2021-08-30T20:57:04Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![RobinB](https://avatars.discourse-cdn.com/v4/letter/r/3d9bf3/32.png) [@RobinB](https://forums.knack.com/u/RobinB)\
**Post date:** [August 30, 2021, 8:57pm UTC](https://forums.knack.com/t/posting-a-new-record-with-a-connection/10996/1 "2021-08-30T20:57:04Z")

</div>

I am posting a new record (a purchase order) via the API and want the new record to include a CONNECTION to an existing record in another table (Trade = vendor).

I have verified that I have the correct ID of the Trade, but can’t manage to insert it into the new record’s connection field. There is no error, but the connection field is blank in the new record.

```auto

        // 1) get record ID of connected Trade
        var TradeArray = record["field_83_raw"];                        
        var TradeRecId = TradeArray[0].id; // returns 6112de58e52bbe001ea75d74

                    // 2) ADD A RECORD TO PURCHASE ORDERS TABLE
                    // neither of these syntax are successful
                    var MydataObject = {						   
                        //"field_149_raw": [TradeRecId]        
                        "field_149_raw": TradeArray[0].id
                    }; 	

```

---

<div class="post-metadata">

**Author:** ![RobinB](https://avatars.discourse-cdn.com/v4/letter/r/3d9bf3/32.png) [@RobinB](https://forums.knack.com/u/RobinB)\
**Post date:** [August 31, 2021, 6:09pm UTC](https://forums.knack.com/t/posting-a-new-record-with-a-connection/10996/2 "2021-08-31T18:09:57Z")

</div>

I figured it out. I was trying to POST to the _raw_ version of the field. The syntax that works is

```auto
 "field_149": TradeArray[0].id  

```
