Allow user to copy rich text

I have some data in two Airtable fields formatted as both Markdown and HTML. In noloco I’m displaying the Markdown field with the field type set as Markdown so it displays nicely formatted to the user.

I would like the user to be able to copy the content of this field as rich text that they can they paste into other text editors. The native noloco copy button works great, but copies the raw Markdown.

I have a working native JavaScript solution. Is there a way to use this JS and link it to Record Button? The JS would need something passed to target the relevant div to get the field content.

Any help or other solutions would be appreciated. Thank you!

1 Like

@nick - I was attempting to solve this issue awhile back and I eventually made my own self hosted page with a button that I embed as an Iframe in Noloco…

I would pass the record UUID to the self hosted page via a URL parameter… so, mysever.whatever/noloco/copybutton.html?recordUUID=rec12345 (the record ID is set via the ‘input url’ field in Noloco with a dynamic value that is the record UUID) - On that HTML page I would look up the relevant record in Noloco via the API and pull the markdown to be copied and add it to the button (I actually built in a webhook on the page that fires when the button is pressed to my server and runs the logic to pull the record data, then the webhook returns the markdown value to load in the button… never store your noloco API details in an HTML document, always sever side).

I did custom CSS nonsense within Noloco to resize the iframe that held the copy/paste button iframe so that it would be a specific height and set it right above the text editor which had the markdown rich text editor the user was editing.

This is not an ideal solution hah, but worked for me.

Here’s roughly the code I used to generate the button which has the text - obviously you’d need quite a bit of customizing to get it to pull the text:

I would recommend putting this in as a Feature Requests post, @darragh and team are often quick to implement things like this! (it’s what I should have done but i think i built that out before this forum was up lol)

1 Like

Thanks Sean, I’ll give this a try! I’ve added a feature suggestion also as recommended. Thank again.