If you have a DOCX file that you want to convert into a PDF, you can use a Flow to handle this. Use the “Convert a DOCX to PDF” action in the Flow Builder.
You can write your own logic to define the record and Content Document that needs to be converted.
Properties to set:
- Content Document Id: Mandatory – Id of the ContentDocument that is the DOCX file
- Record Id: Mandatory – Id of the record the PDF should be linked to
- Run Async: Optional – False by default. Set to “TRUE” if you are running for a trigger or you have done other updates/inserts in the same transaction
- Save as new Content Document Version: Optional – False by default. Set to “TRUE” when there should not be a new ContentDocument created but the PDF has to be added as a new version to the Content Document provided (see parameter 1)
Return values:
There will only be return values when Run Async is “FALSE”!
-
Content Document Id: the new ContentDocumentId if Save as new Content Document Version is “FALSE”
- Content Version Id: the new ContentVersionId