We are using Javascript for a custom HTML Element but what we cannot figure out is how to add a Copy to clipboard function that copys the data from a database.
There would be multiple of these buttons and each one would copy a different part of the information on the database to your clipboard.
would appreciate any help with this Wix or Velo has been giving me a hard time to get what i need it to do.
P.s.
To Clarify these buttons would be apart of the code inside the html element and would grab data from the database.
Hey Matt.
Just to start, if you’d like to copy code from the Database, you could pull it from the collection using wixData, and copy it using Wix Window’s Copy To Clipboard - copyToClipboard - Velo API Reference - Wix.com. This allows you to avoid passing data back and forth between the site and your HTML element using postMessage.
If you need it to be done within the HTML element, you could use the Async Clipboard API to do so. It works the same as Wix’s Copy To Clipboard, but you access it using the native navigator in your iframe.
Thank you so much for the reply is it at all possible to contact you using discord to share more information?
the way we have it atm is a button and that button opens a small window with the text in it you have to manually copy.
but we where able to get it to connect to a database and each button has a different thing problem is opening these windows bugs out the element.
if i could show you i think things would be easier to understand but if you do not feel ok with sharing discord info i can try to msg it to you on here or something lmk thank you.
Sure, you can tag me in the #help channel on Discord at @ChristopherDerrell