Title: OR statement
Last modified: September 10, 2024

---

# OR statement

 *  Resolved [sajtfokus](https://wordpress.org/support/users/sajtfokus/)
 * (@sajtfokus)
 * [1 year, 9 months ago](https://wordpress.org/support/topic/or-statement/)
 * Hi,
   Is there a way to incorporate OR logic into this:
 *     ```wp-block-code
       <%fieldname1_block if_value_like={{apple}}%> OR <%fieldname2_block if_value_like={{orange}}%>some text<%fieldname1_endblock%><%fieldname2_endblock%>
       ```
   

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Author [codepeople](https://wordpress.org/support/users/codepeople/)
 * (@codepeople)
 * [1 year, 9 months ago](https://wordpress.org/support/topic/or-statement/#post-18006923)
 * Hello [@sajtfokus](https://wordpress.org/support/users/sajtfokus/)
 * Thank you very much for using our plugin.
 * If you embed block/endblock tags you would be implementing an “and” operator:
 *     ```wp-block-code
       <%fieldname1_block if_value_like={{apple}}%> <%fieldname2_block if_value_like={{orange}}%>some text<%fieldname2_endblock%><%fieldname1_endblock%>
       ```
   
 * There are two possible solutions to implement an “or”:
    - You can insert a calculated field in the form to be used as an auxiliary (
      you can hide it by ticking a checkbox in its settings), and enter the equation:
 *     ```wp-block-code
       IF(OR(fieldname1 == 'apple', fieldname2 == 'orange'), 1, 0)
       ```
   
 * And use the block tags:
 *     ```wp-block-code
       <%fieldname3_block if_value_is={{1}}%>some text<%fieldname3_endblock%>
       ```
   
    - The second alternative requires to duplicate blocks:
 *     ```wp-block-code
       <%fieldname1_block if_value_like={{apple}}%> some text<%fieldname1_endblock%><%fieldname1_block if_value_unlike={{apple}}%> <%fieldname2_block if_value_like={{orange}}%>some text<%fieldname2_endblock%><%fieldname1_endblock%>
       ```
   
 * The previous structure prevents repeating the “some text” text.
 * Best regards.
 *  Thread Starter [sajtfokus](https://wordpress.org/support/users/sajtfokus/)
 * (@sajtfokus)
 * [1 year, 9 months ago](https://wordpress.org/support/topic/or-statement/#post-18008768)
 * Thank you!

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘OR statement’ is closed to new replies.

 * ![](https://ps.w.org/calculated-fields-form/assets/icon-256x256.jpg?rev=1734377)
 * [Calculated Fields Form](https://wordpress.org/plugins/calculated-fields-form/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/calculated-fields-form/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/calculated-fields-form/)
 * [Active Topics](https://wordpress.org/support/plugin/calculated-fields-form/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/calculated-fields-form/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/calculated-fields-form/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [sajtfokus](https://wordpress.org/support/users/sajtfokus/)
 * Last activity: [1 year, 9 months ago](https://wordpress.org/support/topic/or-statement/#post-18008768)
 * Status: resolved