Forum Discussion

Team_Kinnect's avatar
Team_Kinnect
Qrew Trainee
4 months ago

CopyText.html code page

Has anyone had success with the CopyText.html code page?

I have implemented it an application per instructions from the Code Pages app and when I click on the URL button, a new page opens with only this text on it: "This page will close momentarily."

This is the URL formula:

URLRoot() & "db/" & AppID() & "?a=dbpage&pageID=27&copyText=" & URLEncode([Notes])

This is the code page:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
This page will close momentarily.

<script>
        let urlParams = new URLSearchParams(window.location.search);
        let copyText = urlParams.get('copyText');

        navigator.clipboard.writeText(copyText).then(function()
        {
            setTimeout(function () {
            window.close();}
        , 250)
        })
</script>
</body>
</html>


<!--
These code samples are provided "AS IS" without any warranties of any kind and is not supported by Quickbase teams.
You are responsible for the security and maintenance of any third-party code inside of your application.
Any reliance on Quickbase functions, HTML, CSS or other document-object-model (DOM) elements should be considered unstable and may change at any time, without notice.

Builders should not reference or rely on common libraries hosted by Quickbase (such as jQuery or Angular) as these may change at any time.
Customers should reference their own hosted libraries or from 3rd-party resources that they can trust and maintain
-->

 

2 Replies

  • Denin's avatar
    Denin
    Qrew Captain

    I tried it right now and it worked. What does the URL look like for you after you click the formula button?

    Also the browser might display a confirmation message:

    If it doesn't work, and the URL is correct, then maybe your browser is blocking it.

    • MarkShnier__You's avatar
      MarkShnier__You
      Icon for Qrew Legend rankQrew Legend

      Maybe look to see if there is an icon near the URL saying popup blocked and set that to Allow.