Skip to main content
Question

Document Template Save PDF to field in Record API Pipeline

  • March 13, 2025
  • 0 replies
  • 246 views

Forum|alt.badge.img+6

I have been wracking my head all day on this.  I was reading Generate Documents from your records in your app where it says "However, you can also create API calls and use Pipelines, code pages, or custom integrations to generate documents. Each part of the formula represents an API parameter.".  I was using Restful "Generate a Document" and was able to make a request:

How do I get the output of making a request or basically the document template for this record as a file attachment in the record?  I tried using:

<qdbapi>

<rid>1700</rid>

<field fid="22" filename="Model_T.jpg"> Base64 encoded file content</field>

 

Thank you so much!

Forum|alt.badge.img+6
  • Author
  • Quickbase Alumni
  • March 13, 2025

Here is the below image as well hope that helps:

 


JimHarrison
Forum|alt.badge.img+16
  • Quickbase Alumni
  • June 13, 2025

In the Print formula the var can look like any of these:

var text fileName = [Override Template Name];

https://api.quickbase.com/v1/docTemplates/1/generate?&tableId=bkp8cwnzs&realm=hardermech.quickbase.com&format=pdf&pageSize=Letter&margin=0.25%200.25%200.25%200.25&unit=in&orientation=portrait&recordId=3364&filename=512604-19254.Oregon.Summit

var text fileName = ""&[Override Template Name]&""; (this is not needed but it works)

https://api.quickbase.com/v1/docTemplates/1/generate?&tableId=bkp8cwnzs&realm=hardermech.quickbase.com&format=pdf&pageSize=Letter&margin=0.25%200.25%200.25%200.25&unit=in&orientation=portrait&recordId=3364&filename=512604-19254.Oregon.Summit

var text fileName = ""& URLEncode([Override Template Name])&"";

https://api.quickbase.com/v1/docTemplates/1/generate?&tableId=bkp8cwnzs&realm=hardermech.quickbase.com&format=pdf&pageSize=Letter&margin=0.25%200.25%200.25%200.25&unit=in&orientation=portrait&recordId=3364&filename=512604-19254.Oregon.Summit%20Contracting%20LLC

Also update the var text url line to look like this: (look, the filename is at the end)

var text url = "https://api.quickbase.com/v1/docTemplates/1/generate?&tableId=" & $tableId & "&realm=" & $qbRealm &"&format=" & $format &"&pageSize=Letter&margin=" & $margin &"&unit=in&orientation=portrait&recordId=" & ToText([Record ID#])&"&filename=" & $fileName;