Embed a Web Page in a Form

  • 0
  • 1
  • Question
  • Updated 1 month ago
  • Answered
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. 
Photo of bgstatdex

bgstatdex

  • 380 Points 250 badge 2x thumb

Posted 3 months ago

  • 0
  • 1
Photo of Ⲇanom the ultimate (Dan Diebolt)

Ⲇanom the ultimate (Dan Diebolt), Champion

  • 30,044 Points 20k badge 2x thumb
> 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:


Photo of bgstatdex

bgstatdex

  • 380 Points 250 badge 2x thumb
Ok AWESOME!  Works perfectly, thanks Dan.
Photo of Tyler Parker

Tyler Parker

  • 860 Points 500 badge 2x thumb
Hi Dan, does this method work for videos, for instance, on Youtube? When I try substituting a Youtube URL it fails to connect.
Photo of Ryan Stanford

Ryan Stanford

  • 1,014 Points 1k badge 2x thumb
This is EXACTLY what I was looking for. It's able to reference custom HTML Code Pages.