Best answer

Generating an embeddable HTML file

  • 10 December 2021
  • 7 replies
  • 1055 views

The ideal end goal is to take some record data stored in a relational database and use it to modify the HTML structure of a file. Then the html code will be saved as an .HTML file and embedded on another page via iframe. We need the embed link to be reachable via Zapier, as changes occur quite often.

 

I’ve found Google Drive and Dropbox block files from being embedded (displays as just text) and Amazon S3 buckets don’t have an embed link after you upload into them. Does anyone have any advice on where we could send our generated .html files to for embedding?

icon

Best answer by BAMMichael 13 December 2021, 17:17

View original

This post has been closed for comments. Please create a new post if you need help or have a question about this topic.

7 replies

Userlevel 7
Badge +14

Hi @BAMMichael 

Does the HTML have to be saved as a file or can the HTML be saved in a database field?

 

You could use an operational database app such as Airtable.https://zapier.com/apps/airtable/integrations#triggers-and-actions

Airtable has a Long Text field: https://support.airtable.com/hc/en-us/articles/360042311934-Long-text-field

Airtable Long Text fields currently has a limit of 100k characters

Userlevel 7
Badge +14

@BAMMichael

You can use Dropbox Find File action which has a setting to include file contents.

NOTE: You may have an issue with the Zap if the .html file contents are large in size.

 

 

We use Knack, which unfortunately screens through the html code and removes basically anything that isn’t a text format.

 

Tried Dropbox, it does not support embedding html files. I need the <iframe> to show a file, not the txt contents of it.

If we click the “Open” button on the file in an Amazon S3 Bucket, it does open correctly. Issue is that Zapier doesn’t have any way to obtain this value.

Userlevel 7
Badge +14

@BAMMichael 

You may have to explore using the S3 API to retrieve files: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html

App APIs can be used in Zaps with the Code app or Webhooks app.

Code: https://zapier.com/apps/code/help

Webhooks: https://zapier.com/apps/webhook/help

Solved, spoke with a CS friend and he directed me to add a bucket policy edit to allow all Read-Only access to work without a security token. At this point, the file URL becomes “amazon link” / “filename.extension” and we can fill in the rest from there.

Userlevel 7
Badge +9

Thanks for sharing your solution with the rest of the community, @BAMMichael! Glad you were able to get this sorted. 🎉