Using "The Expression" to apply conditional formatting. - InfoPath Dev
in

InfoPath Dev

Using "The Expression" to apply conditional formatting.

Last post 10-17-2008 10:55 PM by swathip. 15 replies.
Page 1 of 2 (16 items) 1 2 Next >
Sort Posts: Previous Next
  • 10-17-2008 01:42 AM

    Using "The Expression" to apply conditional formatting.

    Hi,

     

    I have multiple (Boolean) checkboxes on a browser form. I need to apply conditional formatting which specifies if all the checkboxes are cleared (false) then a certain control is hidden. If at least one of the checkboxes is selected (true) I need a different control to be hidden.

    I have played around with this for a while now, but am unable to get it to work. There are about 20 checkboxes.

     

    Any help would be marvelous.

     

    Thanks,

  • 10-17-2008 02:12 AM In reply to

    Re: Using "The Expression" to apply conditional formatting.

    Hi,

    1.       Use the following expression to hide the control when all check boxes are false. Go to the conditional formatting of the text box and in the first drop down select ‘TheExpression’ in the side box paste the following expression.

    my:field1 = string(false()) and my:field2 = string(false()) and my:field3 = string(false()) and my:field4 = string(false()) and …

    here field1,field2, field3,.. are check boxes.

    2. Use the following expression to hide the text box if atleast one of the check boxes is true.

    my:field1 = string(true()) or my:field2 = string(true()) or my:field3 = string(true()) or my:field4 = string(true()) or …

    here field1,field2, field3,.. are check boxes.

         

     

    Swathip
    www.ggktech.com
  • 10-17-2008 02:25 AM In reply to

    Re: Using "The Expression" to apply conditional formatting.

    Hi,

     

    Thanks very much for the prompt reply. I have just tried this and it still does not work. It splits the expression into the 5 levels of conditional formatting that are allowed within the form, with the top expression box containing the bulk of the expression.

     

    I should add that the xPath for these fields is different, eg. some are my:field1 and some are myFields/my:Stage1_Step3/my:field2. Would this make a difference?

     

    Thanks again,

  • 10-17-2008 02:56 AM In reply to

    Re: Using "The Expression" to apply conditional formatting.

    Hi,If the field Xpath is ‘/my:myFields/my:Test/my:Test1’ then you should use the following in expression.my:Test/my:Test1 = string(false())In your case, the xpath is ‘myFields/my:Stage1_Step3/my:field2’. So you should use my:Stage1_Step3/my:field2= string(false())Basically just remove the root node. 

     

    Swathip
    www.ggktech.com
  • 10-17-2008 03:07 AM In reply to

    Re: Using "The Expression" to apply conditional formatting.

    Hi and thanks again,

     

    This is the expression I am using, but it still doesn't work:

     

    my:Stage1_Step3/my:Condition_Survey= string(false()) and  my:Survey_Required= string(false()) and  my:Measured_Survey_Required= string(false()) and my:Stage1_Step3/my:Property_Val= string(false()) and my:Disposal_Val= string(false()) and my:Commercial_Val= string(false()) and my:Electrical_Required= string(false()) and my:Gas_Required= string(false()) and my:Drains_Required= string(false()) and my:Party_Wall_Required= string(false()) and my:Right_Of_Light_Required= string(false()) and my:Condition_Required= string(false()) and my:Dilapidations_Required= string(false()) and my:Stage1_Step3/my:DDA_Required= string(false()) and my:Witness_Required= string(false()) and my:Project_Required= string(false()) and my:Stage1_Step3/my:Facilities_Management= string(false()) and my:Planning_Required= string(false()) and my:Stage1_Step3/my:Feasibility_Repandt= string(false()) and my:Design_Required= string(false()) and my:Stage1_Step3/my:Fees_Advice= string(false())

     

    and:

     

    my:Stage1_Step3/my:Condition_Survey= string(true()) or  my:Survey_Required= string(true()) or  my:Measured_Survey_Required= string(true()) or my:Stage1_Step3/my:Property_Val= string(true()) or my:Disposal_Val= string(true()) or my:Commercial_Val= string(true()) or my:Electrical_Required= string(true()) or my:Gas_Required= string(true()) or my:Drains_Required= string(true()) or my:Party_Wall_Required= string(true()) or my:Right_Of_Light_Required= string(true()) or my:Condition_Required= string(true()) or my:Dilapidations_Required= string(true()) or my:Stage1_Step3/my:DDA_Required= string(true()) or my:Witness_Required= string(true()) or my:Project_Required= string(true()) or my:Stage1_Step3/my:Facilities_Management= string(true()) or my:Planning_Required= string(true()) or my:Stage1_Step3/my:Feasibility_Report= string(true()) or my:Design_Required= string(true()) or my:Stage1_Step3/my:Fees_Advice= string(true())

     

    Many thanks,

  • 10-17-2008 03:18 AM In reply to

    Re: Using "The Expression" to apply conditional formatting.

    Hi,

     Can you send the xpaths of the 20 check boxes?

    Swathip
    www.ggktech.com
  • 10-17-2008 03:23 AM In reply to

    Re: Using "The Expression" to apply conditional formatting.

    Sure,

     

    /my:myFields/my:Stage1_Step3/my:Condition_Survey
    /my:myFields/my:Survey_Required
    /my:myFields/my:Measured_Survey_Required
    /my:myFields/my:Stage1_Step3/my:Property_Val
    /my:myFields/my:Disposal_Val
    /my:myFields/my:Commercial_Val
    /my:myFields/my:Electrical_Required
    /my:myFields/my:Gas_Required
    /my:myFields/my:Drains_Required
    /my:myFields/my:Party_Wall_Required
    /my:myFields/my:Right_Of_Light_Required
    /my:myFields/my:Condition_Required
    /my:myFields/my:Dilapidations_Required
    /my:myFields/my:Stage1_Step3/my:DDA_Required
    /my:myFields/my:Witness_Required
    /my:myFields/my:Project_Required
    /my:myFields/my:Stage1_Step3/my:Facilities_Management
    /my:myFields/my:Planning_Required
    /my:myFields/my:Stage1_Step3/my:Feasibility_Report
    /my:myFields/my:Design_Required
    /my:myFields/my:Stage1_Step3/my:Fees_Advice

     

    Thanks again for your help with this.

  • 10-17-2008 03:43 AM In reply to

    Re: Using "The Expression" to apply conditional formatting.

    Hi,

    You are using 'my:Feasibility_Repandt' instead of 'my:Feasibility_Report' in 19th xpath.

    Swathip
    www.ggktech.com
  • 10-17-2008 03:46 AM In reply to

    Re: Using "The Expression" to apply conditional formatting.

    Thanks, I did notice that and have changed it. Darn Replace All.

     It still doesn't work though.

    :-)

  • 10-17-2008 03:57 AM In reply to

    Re: Using "The Expression" to apply conditional formatting.

    Hi,

    I verified that in a sample form. It is working fine. I verified to hide the text box control. Which control you are trying to hide?

    Swathip
    www.ggktech.com
  • 10-17-2008 04:34 AM In reply to

    Re: Using "The Expression" to apply conditional formatting.

    Hi,

     

    I'm using it to hide a button. I am applying the formatting on the button itself. 

     

    Thanks,

  • 10-17-2008 04:52 AM In reply to

    Re: Using "The Expression" to apply conditional formatting.

    Hi,

    Once check the value of the check box by taking expression box when it is checked and unchecked. and also check the properties of the check box(by double clicking on the field), which value is selected in 'value when checked' and  'value when cleared' drop downs. Check the same for all check boxes.

    Swathip
    www.ggktech.com
  • 10-17-2008 05:02 AM In reply to

    Re: Using "The Expression" to apply conditional formatting.

    The expression box shows, true when checked and false when unchecked. The values in the dropdown are TRUE for checked and FALSE for unchecked.

     They are all boolean and have a default state of Cleared.

    Thanks again,

  • 10-17-2008 05:22 AM In reply to

    Re: Using "The Expression" to apply conditional formatting.

    Hi again,

     

    I solved it (well you solved it).

     

    I needed to use the following:

     

    ../my:Stage1_Step3/my:Condition_Survey= string(false()) and  ../my:Survey_Required= string(false()) and  ../my:Measured_Survey_Required= string(false()) and ../my:Stage1_Step3/my:Property_Val= string(false()) and ../my:Disposal_Val= string(false()) and ../my:Commercial_Val= string(false()) and ../my:Electrical_Required= string(false()) and ../my:Gas_Required= string(false()) and ../my:Drains_Required= string(false()) and ../my:Party_Wall_Required= string(false()) and ../my:Right_Of_Light_Required= string(false()) and ../my:Condition_Required= string(false()) and ../my:Dilapidations_Required= string(false()) and ../my:Stage1_Step3/my:DDA_Required= string(false()) and ../my:Witness_Required= string(false()) and ../my:Project_Required= string(false()) and ../my:Stage1_Step3/my:Facilities_Management= string(false()) and ../my:Planning_Required= string(false()) and ../my:Stage1_Step3/my:Feasibility_Report= string(false()) and ../my:Design_Required= string(false()) and ../my:Stage1_Step3/my:Fees_Advice= string(false())

     

    and

     

    ../my:Stage1_Step3/my:Condition_Survey= string(true()) or  ../my:Survey_Required= string(true()) or  ../my:Measured_Survey_Required= string(true()) or ../my:Stage1_Step3/my:Property_Val= string(true()) or ../my:Disposal_Val= string(true()) or ../my:Commercial_Val= string(true()) or ../my:Electrical_Required= string(true()) or ../my:Gas_Required= string(true()) or ../my:Drains_Required= string(true()) or ../my:Party_Wall_Required= string(true()) or ../my:Right_Of_Light_Required= string(true()) or ../my:Condition_Required= string(true()) or ../my:Dilapidations_Required= string(true()) or ../my:Stage1_Step3/../my:DDA_Required= string(true()) or ../my:Witness_Required= string(true()) or ../my:Project_Required= string(true()) or ../my:Stage1_Step3..../../my:Facilities_Management= string(true()) or ../my:Planning_Required= string(true()) or ../my:Stage1_Step3/my:Feasibility_Report= string(true()) or ../my:Design_Required= string(true()) or ../my:Stage1_Step3/my:Fees_Advice= string(true())

     

    Many thanks again, you're a star.

     

    :-)

  • 10-17-2008 05:35 AM In reply to

    Re: Using "The Expression" to apply conditional formatting.

    Hi,

    Once verify by putting condition expression in a expresson box and what it is returning. If it returns false then delate one by one field from expression and check.

    Swathip
    www.ggktech.com
Page 1 of 2 (16 items) 1 2 Next >
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.