Forum Discussion

BarryGulino's avatar
BarryGulino
Qrew Cadet
7 years ago

Embed a Web Page in a Form

We are auditing data that is on the internet.  Our records contain data that is available on websites we subscribe to.  The data is provided to us and we are to compare it to the data that is on the website.  It would be helpful if we could see the web page that we are auditing on a tab in our form so it would be next to our data.  The perfect option would be similar to the Web Page Widget for Quickbase pages.  Each record would have its own unique URL to view.  Is there a way to make this work with a Formula Rich Text Field?  Thanks in advance for any help. 
  • > Is there a way to make this work with a Formula Rich Text Field? 

    Yes you can do this with one Formula Rich Text Field with no additional setup other than having a field for the [URL]. Live Demo here:



    Web on Tab ~ Display Record 1
    https://haversineconsulting.quickbase.com/db/bpbzpm7w6?a=dr&rid=101

    Pastie Database
    https://haversineconsulting.quickbase.com/db/bgcwm2m4g?a=dr&rid=719

    Notes:

    (1) The URL must use the https protocol.

    (2) Some domains do not allow you to place their URLs within <iframe>s because they set a response header that requires the <iframe>'s src URL to have the same origin as the page hosting the <iframe>:


    This happens for https://google.com for instance:

    https://haversineconsulting.quickbase.com/db/bpbzpm7w6?a=dr&rid=102

    (3) The Rich Text Formula field [Web] has the following formula (which uses the 3Q&S Technique):
    "<img data-url='" & [URL] & "'" &
    " src onerror='
    (async () => {
      var url = this.dataset.url;
      this.outerHTML = '<iframe src=${url} width=800px height=600px></iframe>';
    })();
    '>"

    (4) [Web] should be configured to that it does not show up on reports and is not searchable:


    • MackenziePhilli's avatar
      MackenziePhilli
      Qrew Trainee
      I get a blank gray window displaying when trying this.

      Here is my code in a Rich Text field:

      "<img data-url='" & [GCs Form URL] & "'" &
      " src onerror='\n(async () => {\n var url = this.dataset.url;\n this.outerHTML = '<iframe src=${url} width=800px height=600px></iframe>';\n})();\n'>"

      [GCs Form URL] is a URL formula type field and I've tested the link and it works. Any help?

      ------------------------------
      Mackenzie Phillips
      ------------------------------
      • MarkShnier__You's avatar
        MarkShnier__You
        Icon for Qrew Legend rankQrew Legend
        Is your website HTTPS or HTTP. Only HTTPS has a chance of working.

        ------------------------------
        Mark Shnier (YQC)
        Quick Base Solution Provider
        Your Quick Base Coach
        http://QuickBaseCoach.com
        mark.shnier@gmail.com
        ------------------------------
  • TylerParker's avatar
    TylerParker
    Qrew Assistant Captain
    Hi Dan, does this method work for videos, for instance, on Youtube? When I try substituting a Youtube URL it fails to connect.
  • This is EXACTLY what I was looking for. It's able to reference custom HTML Code Pages.