Skip to main content
Skip table of contents

Common Commands

The amount of different commands available is rather large and finding the right tool for the job can be difficult. This article aims to introduce some of the commands performing the more common tasks.

Retrieving Salesforce data

To get any Salesforce data to present in your document or to be used in the logic in other ways, the commands that retrieve the data from your Salesforce organization are needed. These are record, relatedList, relatedListRecord and query. To download a file from Salesforce, use load.

  • The record command gets data of a single record. The relatedList command gets data of multiple records related to a specific record, and relatedListRecord works like relatedList but picks only one of the related records. These can be considered to be the three basic Salesforce data retrieval commands.

  • The query command allows you to get whatever data a freely defined SOQL query can get. Using this command requires at least some knowledge of SOQL, but it is the most powerful and versatile command of its kind.    

  • The load command downloads the data of a specified File or legacy Attachment in your organization.

Document generation

The Flow of most Dynamo templates aims to produce a document of some kind, and usually the end result is supposed to be a PDF file. There are two commands that make this happen: composeContent and exportPDF.

  • The composeContent command takes a document part of your Online template and evaluates all the logic elements and attributes within, producing a composed document. Without this command somewhere in your logic, your end result will end up being a document without any of the data placeholders and such transformed into the information they should be presenting.

  • The exportPDF command is able to transform a HTML file, such as a document part in an Online template, into a PDF file. It is typically used to produce a PDF out of the composed HTML document produced by composeContent.

Saving files

If you'd like to save the produced document or something else into Salesforce, the createContentVersion command is generally the command for that. Maybe you'd like to also post the file into a Chatter feed? The postFeedItem can help with that.

  • The createContentVersion command uploads a file into your Salesforce organization's Files. This File can be linked to a record, such as your logic's main record, or placed into a Library. This command can also be used to upload a new version for an existing Salesforce File.

  • The postFeedItem command creates a Chatter post into a feed. Combined with createFeedAttachment and createContentVersion, the created Chatter post can have the produced document or another file as one of its attachments.

Controlling the logic

While the logic control commands and their functionality are introduced already in the Command sequence article, they are important enough to be highlighted here as well. These logic control commands being if, choose, when, otherwise and forEach. Worth mentioning along them is also next, which is a command essential for building a Flow.

  • The if, choose, when and otherwise commands exist for making other commands conditional.

  • The forEach command exists to allow other commands to individually handle items of a Collection, such as a Salesforce query result, in the logic.

  • The next command directs the Flow from the current Step into another.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.