Introduction

S-Docs allows you to easily leverage conditional logic within your templates with the RENDER feature. You can insert render statements by the click of a button in the WYSIWYG template editor without any HTML code. You can watch the video below for a quick tutorial, or refer to the written instructions under the video.

Video Tutorial

Use The Insert RENDER Button

Go to the template for which you would like to add render statements, and click the Insert RENDER button.

Using this button, you can add a variety of render statements into your template.

The Insert RENDER Menu

This is the Insert RENDER menu. Using this interface, we will build our conditional statement by simply pointing and clicking, and then enter the content that will be conditionally rendered based on our conditions. Let's start with step 1: Select your conditions.

Start by [1] selecting a field. This picklist will let you choose from any field available on your template's base object. Then, [2] choose your operator. As you can see from the picklist, you can choose from equal-to, not-equal-to, greater-than, less-than, greater than or equal to, less than or equal to, contains, and not contains. Next, [3] choose the value that you want your statement to evaluate. Then, [4] add the condition to the render statement.

After you add your first condition, you'll be able to add additional ones using AND  OR. In this example, our condition will evaluate whether or not our contact's mobile and business phone values are null. Once your conditions are added into Step 2, you can edit them manually by simply clicking within the text box. After completing your render statement, you can move on to Step 3 to enter your conditionally rendered contents.

As you can see here, we've [1] finished our conditional statement. Now it's time to tell S-Docs what to render if the statement evaluates to true. To make this easier, you can [2] select fields from your object to include in your conditionally rendered contents from the field picker. Select a field, and [3] click Add Field. This will add the merge field into the text box below, which is where you can write what will be conditionally rendered. As you can see here, if a contact has both a mobile and business phone on record, the document will include a small paragraph that provides this information.

Once you finish entering your conditionally rendered contents, click Insert. The template editor will format your render statement in the correct syntax, as follows:

From here, you can continue formatting your document however you like, or edit the render statement itself. For more information on conditional logic within a template and nested render statements (including writing render statements yourself), click here.

Note: If any fields in your render statement contain words and have a field type anything other than a basic string type (rich text, textarea, longtext, function, etc.) you will need to add the  merge field attribute render. For example, if your merge field looked like this: {{!MyTestField}}
The field with the attribute added would look like this: {{!MyTestField render}} Within a render statement, it would look like this:
<!--RENDER= {{!MyTestField render}} == Test -->{{!Opportunity.closedate M/d/yyyy}}<!--ENDRENDER-->
Note that this attribute should only be added to merge fields within render tags (e.g. enclosed by <!-- and -->). In the above example, the attribute  is not added to the {{!Opportunity.closedate M/d/yyyy}} because this merge field is outside of the render tags.
Additionally, note that the Insert RENDER button will not add this attribute automatically. This functionality was added in version 4.48