Expressions

What's covered?

The purpose of this page is not to provide an exhaustive tutorial on expressions but to give some examples and projects you can download to help your understanding.

In Classic version expressions were known as Build Expressions, in the New UI versions of RoboHelp they are known as Condition Expressions. For simplicity they will be referred to as Expressions in this topic.

Originally this topic was for Classic versions of RoboHelp. The 2019 version of RoboHelp introduced a new interface. The topic now covers both versions as the logic has not changed. Expressions are also covered in the RoboHelp Tour.

Introduction

The simplest way to work in RoboHelp is to think along the lines of what you do NOT want to include. In some versions an expression can be written to Include topics but anyone who has tried will confirm that excluding works while including may not get the desired result.

It is also important to understand before getting into using expressions to filter the topics that make it to your output, there a big change in how RoboHelp determines what goes into an output.

  • In Classic versions every topic in your project went into an output unless you excluded it.
  • In the new UI version only topics in your TOC get included in an output. That does not mean the user has to have a TOC showing all the topics as you can hide the TOC link from their view.

RoboHelp Classic Versions

Basic Expressions

Here you would simply list the tags for the topics and/or content that you did not want included in the output. If a topic had any or all of those tags applied, it would be excluded from the output.

Advanced Expressions

Here you use NOT to exclude topics, otherwise the tag becomes included. However, as above, expressions work much better if you think in terms of what to exclude.

RoboHelp New UI

In the New UI (2019 and above) the expressions are created in a different way. You are presented with a list of all the tags on the left and you drag them to the right and select Exclude/Include and AND/OR. Sorry to repeat myself but stick with Exclude.

Untagged Topics

Note that any topic or content that does not have a tag applied will be included in the output.

Show Me Some Examples

That is explained in this output from my demo project. Click here. What you will see a topic that explains how the output will change according to the expression applied.

If you want to create all the outputs so that you can see the effect of the different expressions, you can download the demo project to see how things were set up and generate each output.

Click here for the demo project in Classic format.
Click here for the demo project in 2019 format.
Click here for the demo project in 2020 format. Upgrade this demo for later versions.

RoboHelp 2019 Bug

In Classic versions if an output excluded a topic, the TOC seen by the user automatically excluded the TOC entry. In 2019 it is necessary to apply the tags to the TOC entries as well.

Update 1 for 2020 includes a fix for that bug. The 2020 demo project was generated with that update applied.

Donations

If you find the information and tutorials on my site save you time figuring it out for yourself and help improve what you produce, please consider making a small donation.