Skip to main content

I have 2 complex conditional logic conditions and I would like to see how this can be implemented in Lucid's exiting conditional logic as 1 Rule.

If (@Mode == A) AND [
    if( @Styles == B)  Then
         Set Fill to Blue
    else
         Set Fill to Red
]
I would prefer not to implement 2 Rules:
    If (@Mode == A) AND if( @Styles == B)  Then Set Fill to Blue
   If (@Mode == A) AND if( @Styles != B)  Then Set Fill to Red

Rule 2:
    IF ( Text contains Flag ) AND [ 
         NOT [  If (Text contains "Yes" ) OR If (Text contains "No") ] Then
                   Set Fill to Yellow
       ]
== A * [NOT [ B + C ] ] == A * NOT B * NOT C
    CONTAINS(Flag) AND DOESNOTCONTAIN("Yes") AND DOESNOTCONTAIN("No")
 but it would be interesting how to implement the A * [NOT [ B + C ] ]  as a single rule
--> DOESNOTCONTAIN / CONTAINS take 2 parameters how would I implement that using the formula method?
--- There are no braces to group logic.
      

Hi Naipaul


Thank you for posting your question in the Community! It sounds like your two conditional formatting rules are: 


Rule 1:


IF > Data Source (Formula) > enter value: AND(@Mode='A'@Style=‘B’)


THEN Formatting (Shape Style) > Fill (Blue)


Select the optional "Else condition" and choose "Else"


THEN > Formatting (Shape Style) Fill (Red)



 


Rule 2:


IF > Data Source (Text) > Condition (Contains) Value (Flag)


AND > Data Source (Text) > Condition (Does not contain) Value (No)


AND > Data Source (Text) > Condition (Does not contain) > Value (Yes)


THEN > Formatting (Shape Style) > Fill (Yellow)



 


To answer your question - because each rule relies on different data sources (the first a formula; the second a text input) there is no way to merge these two rules together. Alternatively you can apply both rules to all shapes.



 


Please Note: because both rules rely on different data as inputs but both have fill colors as outcomes if you have a shape that fulfills two rules you can choose which rule is prioritized by ordering them.



I hope this helps - please let us know if you have any additional questions!


I have a few great comments for you & a question.


1. Thanks very very much for your prompt response to my questions.
2. While things can be achieved it's great to have an example to follow rather than being the 'guinea pig'
3. Your solutions are very good and are informative to a wider audience
4. I loved your video within the post it really assisted with the understanding of the steps - great touch


I also appreciated that you brought in the additional concept of Rule Order which could be otherwise missed.


Question: Can you provide a short blurb on how you achieved the embedded video I have an idea but your
statement will help clarify!!


Negative Comments:
a. Your Rule 1 is only part A of my Rule 1 && part of the reason why you had the colour conflict
    - because you left our rule part B and chose the "ELSE" which will affect every other condition with a blanket ELSE
     AND(@Mode='A'@Style=‘B’) Then Blue
b1.  For Not B
     AND(@Mode='A'NOT(@Style=‘B’) ) Then Red
b2. Combining them
   OR(   AND(@Mode='A'@Style=‘B’) Then Blue   AND(@Mode='A'NOT(@Style=‘B’) ) Then Red    )
   -- I do not think that you can implement the colour fill definition in the Rule unless  you setup the OR within the GUI and
     then have 2 Formula separately in the conditions:
     Combined GUI and Formula in 2 parts


-----------
     GUI IF with Rule Formula
         AND(@Mode='A'@Style=‘B’) Then Blue
     GUI ELSE IF with Rule Formula
        AND(@Mode='A'NOT(@Style=‘B’) ) Then Red
-----------

Overall great work a credit to Lucid


Hi Naipaul


I’m glad I was able to help a bit and apologies for the miscommunication! Thank you for clarifying what you are trying to achieve - from what I understand in your response you’re saying that:


My proposed conditional formatting formula addresses two scenarios:
1) If it meets criteria A and B then blue
but 2) if it doesn't then red.


This is achieved by this formula: AND(@Mode='A'@Style='B')


However you’re highlighting that there is a third scenario where it may only meet half of this criteria:
3) it meets criteria A but not B or meets criteria B but not A


If you’d like to have a conditional formatting rule and color fill result for either of these instances you can set a conditional formatting rule with the following formulas:


AND(@Mode='A'@Style<>'B')
AND(@Mode<>’A’@Style=‘B’)


The <> is the comparison operator that means “not equal.”  You can implement this principle to create your desired scenarios and resulting color fills.


Unfortunately combining both of these conditions into one longer condition is not actually possible because it would require entering a formula into the "then" part of the formatting rule. So each of these instances above would need to be their own rule.


As for your question on how I was able to add the embedded video - I use an app called “Giphy Capture” to record a .gif file to include in my posts. You can do the same or include photos/screenshots by simply dragging the file or photo into your post.


Thank you for your detailed questions! A resource you may find helpful is our Developer Docs. Here you can explore the wide variety of formulas that are available and details for how they work. This may assist you as you are customizing your conditional formatting for you desired result.


I hope this helps and am happy to address any follow-up questions you may have!


Reply