Attachement url for html_widget


I’m trying to include in html_widget an .png logos stored in column A
I have retrived the “hard” url with the browser help :

<img src="" alt="" width="240" height="90" />

Is there a way to do this without putting the hardlink so that change in column A will follow in the html_widget ?

1 Like

Hi @Sylvain_Page - attachments are currently hard to access safely from custom widgets. There’s an update coming very soon to resolve this. Watch this space!

If your document happens to be publicly viewable, then you can use image source urls like where NNNN are the ids stored in the attachment column (in your table they’d be available as $ But most docs aren’t publicly viewable, and access to the attachment columns from a custom widget will be denied - hence the update we are working on.

Hi @paul-grist , Thanks for your answer and explanation.
Happy to see you have plans for this issue.

Hello Grist Team,

I still admire your concept for grist, the effort you put on, the patience you have to answer everybody.
Congratulations !

I’d like to know if this topic (accessing attachement, mainly image in custom widget) is still on the roadmap ? Do you think it would be availble in less than three month ?

I can wait untill there and it would save me some work but if it is clearly not planned I have to find a work around.

1 Like

Hi @Sylvain_Page, sorry for the delay in responding. A method of accessing attachments within custom widgets has been developed, reviewed, approved, and should be available next week. I’ll post with the details once they are released.


No problem ! You have lots of request !
Thanks to grist-team !
:+1: :+1:

Hi @Sylvain_Page, there is now a grist.getAccessToken() function available in custom widgets, which gives you a token you can append to attachment urls. There is a usage example at grist.getAccessToken. I’d say we could polish this further to simplify use cases like yours, but at least there should be a solid way to do it now. Hope this helps.

Hello @paul-grist ,

I’m not enough skilled in JS & token to realize that for the moment.
I’ll keep an eye on it maybe later, anyway this is as you said a first step.