How to update an attachment column via API? [Jul 01]

[dummy title body text appended to avoid empty title body]

:raising_hand_man: Bergi9 replied

It get consumed but the attachment column didn’t update.

```ts

import {Api} from ‘nocodb-sdk’;

nocoDbApi = new Api({

baseUrl: ‘https://example.com/’,

headers: {

‘xc-token’: ‘someToken’

}

});

await nocoDbApi.dbTableRow.update(

‘noco’,

‘someProject’,

‘someTable’,

‘someID’,

{

‘someAttachmentColumn’: [

{

url: https://example.com/someimage.png,

mimetype: ‘image/png’,

}

]

});

```

:raising_hand_man: Bergi9 replied

I also tried with axios directly without the nocodb-sdk, same result.

:raising_hand_man: Bergi9 replied

<@&682859083799199814>

:raising_hand_man: FrancyMak replied

Hi, a software engineer will answer as quick as possible.

:person_tipping_hand: o1lab replied

pass the attachment column as a string

:man_technologist: pranavxc replied

You need to pass it as JSON string

```javascript

import {Api} from ‘nocodb-sdk’;

nocoDbApi = new Api({

baseUrl: ‘https://example.com/’,

headers: {

‘xc-token’: ‘someToken’

}

});

await nocoDbApi.dbTableRow.update(

‘noco’,

‘someProject’,

‘someTable’,

‘someID’,

{

‘someAttachmentColumn’: `[

{

“url”: “https://example.com/someimage.png”,

“mimetype”: “image/png”,

}

]`

});```

:raising_hand_man: Bergi9 replied

It worked, thank you!

Autogenerated from discord


Join NocoDB’s community

DiscordTwitterRedditDocs