Skip to main content
Participating Frequently
November 15, 2022
Question

Problem with writing a proper condition expression in RH20

  • November 15, 2022
  • 26 replies
  • 2075 views

Hi, I'm struggling to understand the logic of condition expressions and I have a hard time defining the expression that meets my needs.

I have three client tags : Client A, Client B, Client C.

I have two output tags : Online and Print

Text can be tagged with multiple tags, since some functions are common to Client A and B, or Client A and C, or Client B and C.

Furthermore, in my help topics, I have links to help pages that are specific to one client and that are tagged with Online and Client A, or Online and Client B, etc. And I have links that are common to all clients that are tagged only with Online (since I don't want them in a printed output). 

When I produce my online help for Client A, I want to see text that is tagged with : 

  • Client A
  • Client A and Client B
  • Client A and Client C
  • Online
  • Client A and Online
  • Client A and Client B and Online
  • Client A and Client C and Online

I have successfully built a condition expression that includes all the text tagged Client A, whether alone or in combination with another Clients tag or with the Online tag, and excluded any text tagged with Print. Which is almost what I want.

However, I can't find a way to include also text that is tagged with Online only. Is it possible ? If yes, how ?

 

Here is the condition that I have written so far.

     EXCLUDE when Clients is B

     OR

     EXCLUDE when Clients is C

     AND

     EXCLUDE when Output is Print

     AND

     INCLUDE when Clients is A

 

Whenever I want to introduce Online either with AND or OR, I don't get the result I want.

My first try was to add "OR INCLUDE when Output is Online" at the end, but this makes all texts tagged with Online visible, including the text not tagged with Client A but tagged with Client B and/or Client C that I want hidden.

I have made several other attemps by moving my "OR INCLUDE when Output is Online" elsewhere in the condition, and I also tried with "AND INCLUDE when Output is Online" at various places, but I can't get the right result. I can't understand the logic...

Does anyone have a solution ?

Thanks in advance.

    This topic has been closed for replies.

    26 replies

    Peter Grainge
    Community Expert
    Community Expert
    November 22, 2022

    Upgrading a Classic project sounds good on the basis it should rewrite the expression correctly, in theory. 

     

    Even if it doesn't the tagging will be correct. I'll be happy to look then.

    ________________________________________________________
    My site www.grainge.org includes many free Authoring and RoboHelp resources that may be of help.

     

    Use menu (bottom right) to mark as Best Answer or to Highlight particularly useful replies. Found the answer elsewhere? Share it here.
    Community Expert
    November 22, 2022

    @Peter Grainge do you want me to put together two sample projects, one for classic and one for New UI that shows the condition expression working with Classic and not working with New UI?

    Community Expert
    November 22, 2022

    Actually, I thought of one more test I can try, upgrading a working Classic sample project. I'll let you know how that goes.

    Peter Grainge
    Community Expert
    Community Expert
    November 22, 2022

    For client A I want :

    No text that is tagged Print. PG Expression excludes Print

    1. Any text that includes the tag Client A, so it can be text that is specific to Client A (tagged with only Client A), text that is common to Client A and Client B (tagged with both tags Client A and Client B), text that is common to Client A and Client C (tagged with both tags Client A and Client C), text that is specific to Client A and the Online Help output (tagged with both tags Client A and Online).
      PG Unless there are more tags, then all of those will get published. With exclude Print being the only tag in the expression, all other content will get generated. I think the content that is for Clients B and C only iswhere your problem kicks in. You can't say exclude B in some places but not others. 

     

    For B or C only content, I think that will need a different tag. Clumsy tag names for that would be Exclude if B Only and Exclude if C Only. Then you would add those tags to the expression. Give that a whirl.

    ________________________________________________________

    My site www.grainge.org includes many free Authoring and RoboHelp resources that may be of help.

     

    Use menu (bottom right) to mark as Best Answer or to Highlight particularly useful replies. Found the answer elsewhere? Share it here.
    Peter Grainge
    Community Expert
    Community Expert
    November 22, 2022

    Sorry for the delay but I have just started looking at this and need clarification.

     

    Looking at the requirement in a different way to the original description for Client A you want any content tagged A or Online to appear. It does seem to matter if any other tag is applied. You have said

    Client A
    Client A and Client B
    Client A and Client C

    So if it has Client A applied, you want the text in whether or not B or C is also applied. Correct?

    Plus online of course.

     

    What is confusing me is you have said you want content tagged A and B to appear but in the expression you have excluded B and C.

     

    For an online output it looks like you only need to exclude Print.

     

    What am I getting wrong?

    ________________________________________________________

    My site www.grainge.org includes many free Authoring and RoboHelp resources that may be of help.

     

    Use menu (bottom right) to mark as Best Answer or to Highlight particularly useful replies. Found the answer elsewhere? Share it here.
    Participating Frequently
    November 22, 2022

    Hi Peter,

    I'll try to sum it up better 🙂

    For client A I want :

    • No text that is tagged Print.
    • Any text that includes the tag Client A, so it can be text that is specific to Client A (tagged with only Client A), text that is common to Client A and Client B (tagged with both tags Client A and Client B), text that is common to Client A and Client C (tagged with both tags Client A and Client C), text that is specific to Client A and the Online Help output (tagged with both tags Client A and Online).
    • Any text that is tagged with Online only (therefore excluding text that is tagged with Online and Client B or Online and Client C). >> This is where my condition expression ceases to work... Text with Online only is hidden in the output.

     

    So, if I sum up what I don't want :

    • Text tagged with Print.
    • Text that is specific to Client B or Client C (tagged with Client B only, or tagged with Client C only).
    • Text that is common to Client B and Client C (tagged with both tags Client B and Client C)
    • Text that is specific to the Online Help and Client B (tagged with both tags Client B and Online), and the same for Client C.
    • Text that is specific to the Online Help but common to Client B and Client C (so tagged with the three tags Online, Client B and Client C).

    Is it clearer ?

    Peter Grainge
    Community Expert
    Community Expert
    November 16, 2022

    @Amebr In theory the New UI didn't change how expressions work in any way and I don't think I have seen anyone report that. However, you do know your way around the block so you could have found something.

     

    @Milsademon Two things quickly as I am about to travel.

    1. See if RH2022 Single Sourcing. Tags and Expressions (grainge.org) helps.
    2. You shouldn't need to include topics as everything in the TOC goes into the build unless excluded.

    ________________________________________________________

    My site www.grainge.org includes many free Authoring and RoboHelp resources that may be of help.

     

    Use menu (bottom right) to mark as Best Answer or to Highlight particularly useful replies. Found the answer elsewhere? Share it here.
    Participating Frequently
    November 21, 2022

    Thank you Peter for your answer. I hadn't seen the page you linked to on your website (although I have searched your site before posting here). However, your page doesn't provide a solution for my complex condition expression. As for your point 2. I'm pretty sure I have tried just excluding what I don't want without obtaining the proper result, but I'll try again, just to make sure.

    Community Expert
    November 16, 2022

    I can't do what you want in New UI, but I can in Classic. 😕😕

     

    Firstly I set up a Classic project to figure out how to do it in the product I'm familiar with. I set up a topic with paragraphs tagged with multiple combinations of Client A-C and Online and Print. 

    The I wrote a build expression using the Advanced interface:

    Which I think meets your requirements of adding "stuff" tagged with online only.

    That took me about 2min to set up in Classic.

     

    But replicating that expression as best I can tell in New UI

     

    Results in this:

     

    I've tried about a billion combinations of AND and OR and I can't figure out exactly what it's doing.

     

    For simple cases, Classic and New UI appear to be doing the same thing.

     

    For example "NOT Client_B AND NOT Print" and "Exclude Client_B AND Exclude Print" produce the same thing - it excludes anything tagged with either Client B or Print.

    Switching to OR also produces the same result in both version - it excludes anything tagged with BOTH Client B and Print.

     

    But getting into the more complex equation with both AND and OR, New UI appears to be doing something different from Classic, but I haven't been able to figure out what. 

     

     

    Participating Frequently
    November 21, 2022

    Thanks Amebr for the trials. Like you, I had no problem either with my conditional expression with Classic. 

    I feel a bit discouraged now... I guess we'll need the programmers of Robohelp to explain how it is supposed to work...