The Insert Conditional Logic Button

Introduction

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

Video Tutorial

Use The Insert Conditional Logic Button

Go to the template for which you would like to add conditional statements, and click the Insert Conditional Logic button.

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

The Insert Conditional Logic Menu

This is the Insert Conditional Logic 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. 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 field value that you want your statement to evaluate. Then, [4] add the condition to the conditional statement.

Your condition will [1] be added to the conditional statement below. After you add your first condition, you can [2] add additional ones using AND/OR. Once your conditions are added into Step 2, you can edit them manually by simply clicking within the text box. After completing your conditional 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, which will evaluate whether or not this contact has mobile and business phone information available. 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. When you select a field, [3] the merge field syntax will be added to the text box underneath the field picker. Click Add Field to [4] add the merge field into the bottom text box, which contains the content that will be conditionally rendered if your conditional statement evaluates to true. 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 conditional statement in the correct syntax, as follows:

<!--RENDER= '{{!Contact.mobilephone}}' != 'NULL' && '{{!Contact.phone}}' != 'NULL' -->
This contact has phone information available. Their mobile number is {{!Contact.mobilephone}} and their business number is {{!Contact.phone}}.
<!--ENDRENDER-->

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

Note:  If any fields in your conditional 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 conditional 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 (e.g. not used as a condition in your conditional statement).
Additionally, note that the Insert RENDER button will not add this attribute automatically. This functionality was added in version 4.4

Tags:

Was this helpful?