<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://sugarclub.sugarcrm.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Docmerge displaying if and else tags</title><link>https://sugarclub.sugarcrm.com/explore/help-forums/enterprise-professional/f/enterprise-professional-questions/6282/docmerge-displaying-if-and-else-tags</link><description>Hiya, 
 I am creating a docmerge template with a lot of if/else conditions using || for or and &amp;amp;&amp;amp; for and conditions in it. I am testing in sections and have noticed that the if/else isnt working and the if and else tags are being left in the rendered</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Docmerge displaying if and else tags</title><link>https://sugarclub.sugarcrm.com/thread/28424?ContentTypeID=1</link><pubDate>Fri, 10 Mar 2023 13:46:51 GMT</pubDate><guid isPermaLink="false">5c521d64-519d-47a6-9065-134618b211bf:306f79ab-dc5b-4b50-befe-e58e239150cb</guid><dc:creator>Brenda Rossetto</dc:creator><description>&lt;p&gt;Hmm, I did use the same field in both conditions in my test, although I was using the Type field on the out-of-the-box Accounts module. Here is an example of a condition I used that worked:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;{if account_type == &amp;quot;Customer&amp;quot; || account_type == &amp;quot;Competitor&amp;quot;}&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;So it seems like yours should also work, but maybe we are missing something or you are encountering unexpected behavior. Let us know what you find out with Support!&lt;/p&gt;
&lt;p&gt;-Brenda&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Docmerge displaying if and else tags</title><link>https://sugarclub.sugarcrm.com/thread/28423?ContentTypeID=1</link><pubDate>Fri, 10 Mar 2023 11:50:30 GMT</pubDate><guid isPermaLink="false">5c521d64-519d-47a6-9065-134618b211bf:a37ddab8-c8b8-47db-b323-7afd3ebbf12d</guid><dc:creator>Ross Page</dc:creator><description>&lt;p&gt;Hi Brenda, i think i have found more information on this issue. It seems to be if you use pipes on the same field options, like i am above. i have another file using pipes but the condition uses a different field and works fine. i will raise a support ticket.&lt;/p&gt;
&lt;p&gt;Example&lt;/p&gt;
&lt;p&gt;{if lbl_flued_appliance_c == &amp;quot;Yes&amp;quot; || lbl_wood_burner_c == &amp;quot;Yes&amp;quot;}We will not install an extract fan in the same room as an open flued appliance or a wood burner. Mechanical ventilation provision in other areas may require a gas spillage test.{if lbl_flued_appliance_c == &amp;quot;Yes&amp;quot; || lbl_wood_burner_c == &amp;quot;No&amp;quot;}We will not install an extract fan in the same room as an open flued appliance. Mechanical ventilation provision in other areas may require a gas spillage test.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Docmerge displaying if and else tags</title><link>https://sugarclub.sugarcrm.com/thread/28384?ContentTypeID=1</link><pubDate>Tue, 07 Mar 2023 17:57:36 GMT</pubDate><guid isPermaLink="false">5c521d64-519d-47a6-9065-134618b211bf:ac525a30-68f4-4d40-a9c5-c5c9a48576e2</guid><dc:creator>Brenda Rossetto</dc:creator><description>&lt;p&gt;This syntax seems okay to me, and I also can&amp;#39;t find any known issues around this behavior you&amp;#39;re seeing where the conditional text (&amp;quot;if&amp;quot;, &amp;quot;endif&amp;quot;) appears in the merged document. We might be missing something, but I would also ask Support about this and see if there&amp;#39;s further troubleshooting to be done.&lt;/p&gt;
&lt;p&gt;If you find out what the cause is, let us know so we can all learn. &lt;span class="emoticon" data-url="https://sugarclub.sugarcrm.com/cfs-file/__key/system/emoji/1f642.svg" title="Slight smile"&gt;&amp;#x1f642;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Thanks and good luck!&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;-Brenda&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Docmerge displaying if and else tags</title><link>https://sugarclub.sugarcrm.com/thread/28383?ContentTypeID=1</link><pubDate>Tue, 07 Mar 2023 17:54:58 GMT</pubDate><guid isPermaLink="false">5c521d64-519d-47a6-9065-134618b211bf:f3fe44b0-a6bd-4b12-b26d-f3519ed6a686</guid><dc:creator>Brenda Rossetto</dc:creator><description>&lt;p&gt;That is strange, I have tested the same conditionals using stock fields and it works as expected. I also don&amp;#39;t see any known issues around this, but maybe you are the lucky one to discover a possible issue. &lt;span class="emoticon" data-url="https://sugarclub.sugarcrm.com/cfs-file/__key/system/emoji/1f642.svg" title="Slight smile"&gt;&amp;#x1f642;&lt;/span&gt; Would you mind&amp;nbsp;&lt;a href="https://support.sugarcrm.com/Resources/Working_With_Sugar_Support/#Creating_the_Case"&gt;filing a case with Support&lt;/a&gt;&amp;nbsp;so they can help you look into it further? You can share a link to this thread to give them some of the context.&lt;/p&gt;
&lt;p&gt;If you and Support end up figuring out the issue, it would be nice if you could come back here and let us know the verdict too, if you don&amp;#39;t mind.&lt;/p&gt;
&lt;p&gt;Thank you and sorry I wasn&amp;#39;t able to get it figured out!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Docmerge displaying if and else tags</title><link>https://sugarclub.sugarcrm.com/thread/28379?ContentTypeID=1</link><pubDate>Tue, 07 Mar 2023 15:56:00 GMT</pubDate><guid isPermaLink="false">5c521d64-519d-47a6-9065-134618b211bf:b52c2132-3624-4811-b0d4-2197c226aceb</guid><dc:creator>Ross Page</dc:creator><description>&lt;p&gt;Hey Brenda,&lt;/p&gt;
&lt;p&gt;im getting the same error after the corrections. Would we be able to hop on a meet to go through it together or with someone from the team if possible?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Docmerge displaying if and else tags</title><link>https://sugarclub.sugarcrm.com/thread/28377?ContentTypeID=1</link><pubDate>Tue, 07 Mar 2023 15:21:52 GMT</pubDate><guid isPermaLink="false">5c521d64-519d-47a6-9065-134618b211bf:04ec5c36-3b05-47f6-ab3a-5bb18cc03f23</guid><dc:creator>Ross Page</dc:creator><description>&lt;p&gt;Please see previous GIF.........&lt;/p&gt;
&lt;p&gt;the customer is to anonymise the customer it is for.&lt;/p&gt;
&lt;p&gt;Thanks for the quick response, i think i need to go to sleep!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Docmerge displaying if and else tags</title><link>https://sugarclub.sugarcrm.com/thread/28376?ContentTypeID=1</link><pubDate>Tue, 07 Mar 2023 15:18:26 GMT</pubDate><guid isPermaLink="false">5c521d64-519d-47a6-9065-134618b211bf:e6253997-4637-4b3b-85fe-858c59207fa3</guid><dc:creator>Brenda Rossetto</dc:creator><description>&lt;p&gt;Hey Ross, it looks like the formatting for the use of || is still off. Here is what it is currently vs the correct format:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&amp;nbsp;Current: &amp;nbsp;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;{if cladding_c == &amp;quot;Ship Lap&amp;quot; || &amp;quot;Vertical Tile&amp;quot; || &amp;quot;Rendered&amp;quot; || &amp;quot;Plastered&amp;quot;}&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&amp;nbsp;Corrected:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;&lt;span&gt;{if cladding_c == &amp;quot;Ship Lap&amp;quot; || &lt;span style="background-color:#ffff99;"&gt;cladding_c ==&lt;/span&gt; &amp;quot;Vertical Tile&amp;quot; || &lt;span style="background-color:#ffff99;"&gt;cladding_c ==&lt;/span&gt; &amp;quot;Rendered&amp;quot; || &lt;span style="background-color:#ffff99;"&gt;cladding_c ==&lt;/span&gt; &amp;quot;Plastered&amp;quot;}&lt;/span&gt;&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;The difference is that you can&amp;#39;t join multiple things with a || after the equals sign. Each &lt;code&gt;A == B&lt;/code&gt; condition is standalone, which basically just means you have to repeat&amp;nbsp;&lt;code&gt;cladding_c == [value]&amp;nbsp;&lt;/code&gt;a lot - once for each value you want to check.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;You will need to make the same change for the || statements in the second paragraph. I also see &amp;quot;CUSTOMER&amp;quot; in all caps in the second paragraph - is that intended to be a variable possibly? It could also be capitalized for emphasis, in which case please disregard me. &lt;span class="emoticon" data-url="https://sugarclub.sugarcrm.com/cfs-file/__key/system/emoji/1f603.svg" title="Smiley"&gt;&amp;#x1f603;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;-Brenda&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Docmerge displaying if and else tags</title><link>https://sugarclub.sugarcrm.com/thread/28372?ContentTypeID=1</link><pubDate>Tue, 07 Mar 2023 12:26:58 GMT</pubDate><guid isPermaLink="false">5c521d64-519d-47a6-9065-134618b211bf:1d8a3778-1f13-4e64-ac72-a25dc1f6e688</guid><dc:creator>Ross Page</dc:creator><description>&lt;p&gt;Actually, my other issue is still relevent to this thread. same behavior, more simple as there are no elseif&lt;/p&gt;
&lt;p&gt;I have updated the formatting per the original answer. I have pasted an extract below as well as screenshot of the issue.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;***NOTE: Please ignore the fact the field names have lbl in them, im not accidentaly using the label reference***&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="/resized-image/__size/500x375/__key/communityserver-discussions-components-files/42/pastedimage1678192000974v1.png" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;{#surv_survey_quotes_1}&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;{if is_there_a_loft_c == &amp;quot;Yes&amp;quot; &amp;amp;&amp;amp; lbl_loft_hatch_c == &amp;quot;No&amp;quot;}We were unable to gain access to the loft, due to there being no loft hatch.{endif}&lt;/p&gt;
&lt;p&gt;{if is_there_a_loft_c == &amp;quot;Yes&amp;quot; &amp;amp;&amp;amp; lbl_loft_hatch_c == &amp;quot;No&amp;quot; &amp;amp;&amp;amp; lbl_loft_accessed_c == &amp;quot;No&amp;quot;}We were unable to gain access to the loft during the time of the survey. {endif}&lt;/p&gt;
&lt;p&gt;{if is_there_a_loft_c == &amp;quot;Yes&amp;quot; &amp;amp;&amp;amp; lbl_loft_hatch_c == &amp;quot;No&amp;quot; &amp;amp;&amp;amp; lbl_loft_accessed_c == &amp;quot;No&amp;quot; &amp;amp;&amp;amp; lbl_lost_space_c == &amp;quot;Yes&amp;quot;}During our survey it was noted that the loft is boarded. We may need to remove some of the boards in order to complete our installation and our quotation includes an additional hour of labour to cover these works.{endif}&lt;/p&gt;
&lt;p&gt;{if lbl_small_hatch_c == &amp;quot;Yes&amp;quot;}The loft hatch was not of sufficient size to enable us to carry out our proposals. We ask that you arrange for a larger opening to be provided. This opening needs to be at least 450mm by 500mm.{endif}&lt;/p&gt;
&lt;p&gt;{if lbl_airtight_loft_c == &amp;quot;Yes&amp;quot; &amp;amp;&amp;amp; lbl_must_smell_c == &amp;quot;No&amp;quot;}There was very little air movement in the loft space. To ensure the optimum performance of the positive input ventilation system we would recommend cross-flow ventilation within the loft space. We recommend a qualified roofing contractor completes this work.{endif}&lt;/p&gt;
&lt;p&gt;{if lbl_airtight_loft_c == &amp;quot;No&amp;quot; &amp;amp;&amp;amp; lbl_must_smell_c == &amp;quot;Yes&amp;quot;}There was a musty smell within the loft space. This could be because of a lack of cross- flow ventilation and we would recommend that a qualified roofing contractor investigates this. Good ventilation in the loft is essential to protect the roof trusses.{endif}&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;{/surv_survey_quotes_1}&lt;/strong&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Docmerge displaying if and else tags</title><link>https://sugarclub.sugarcrm.com/thread/28371?ContentTypeID=1</link><pubDate>Tue, 07 Mar 2023 12:17:09 GMT</pubDate><guid isPermaLink="false">5c521d64-519d-47a6-9065-134618b211bf:d2e0fa53-2fb5-4d14-8a32-f0b74726321b</guid><dc:creator>Ross Page</dc:creator><description>&lt;p&gt;I have updated the text and now get a different issue. I have pasted the text below to check formatting. I am now getting &lt;strong&gt;Error:&lt;/strong&gt;&lt;span&gt;&amp;nbsp;Unexpected token &amp;#39;||&amp;#39;. I have another DocMerge issue as well but ill post a new question.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;{#surv_survey_quotes_1}&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;{if cladding_c == &amp;quot;Ship Lap&amp;quot; || &amp;quot;Vertical Tile&amp;quot; || &amp;quot;Rendered&amp;quot; || &amp;quot;Plastered&amp;quot;}The property has a {cladding_c} finish on the external fa&amp;ccedil;ade. The cladding was in {lbl_cladding_condition_c} at the time of the survey. {endif}&lt;/p&gt;
&lt;p&gt;{if cladding_c == &amp;quot;Rendered&amp;quot; || &amp;quot;Plastered&amp;quot;}Due to the nature of the external cladding on the property, there is a possible risk of damage due to core drilling.{elseif cladding_c == &amp;quot;Shiplap&amp;quot; || &amp;quot;Vertical Tile&amp;quot;} Due to the nature of the external cladding on the property,&amp;nbsp;CUSTOMER may require a section to be removed local to the external termination prior to commencing the installation work. We would ask that you arrange to have the cladding removed prior to our visit and then re-instated around the external termination following the completion of the installation work.{endif}&lt;/p&gt;
&lt;p&gt;{if extra_drilling_c == &amp;quot;Yes&amp;quot;}Due to the construction of the property, there may be an additional cost for extra drilling as itemised below. This additional cost will only be charged where relevant and will be based on the extra time taken to complete the drilling. {endif}&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;{/surv_survey_quotes_1}&lt;/strong&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Docmerge displaying if and else tags</title><link>https://sugarclub.sugarcrm.com/thread/28368?ContentTypeID=1</link><pubDate>Tue, 07 Mar 2023 09:13:02 GMT</pubDate><guid isPermaLink="false">5c521d64-519d-47a6-9065-134618b211bf:0180875e-603a-4df5-97ef-882a227cb40f</guid><dc:creator>Ross Page</dc:creator><description>&lt;p&gt;Well that is annoying. i should have known that!!!! ill give them a go and let you know the outcome!&lt;img alt=" " src="https://media.tenor.com/l4UA-U5QbCQAAAAC/jim-carrie-frustrated.gif" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Docmerge displaying if and else tags</title><link>https://sugarclub.sugarcrm.com/thread/28367?ContentTypeID=1</link><pubDate>Mon, 06 Mar 2023 17:38:39 GMT</pubDate><guid isPermaLink="false">5c521d64-519d-47a6-9065-134618b211bf:e28791fa-1c7b-4f9a-b1d1-9b44e20cf54a</guid><dc:creator>Brenda Rossetto</dc:creator><description>&lt;p&gt;Hi Ross, there are a couple of syntax issues in your example. If you fix these, it might resolve the weird behavior you&amp;#39;re seeing:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;code&gt;{else if}&lt;/code&gt; should actually be &lt;code&gt;{elseif}&lt;/code&gt; with no space.&lt;/li&gt;
&lt;li&gt;The proper formatting for &amp;amp;&amp;amp; and || is as follows:
&lt;ol&gt;
&lt;li&gt;&lt;code&gt;{if cladding_c == &amp;quot;Rendered&amp;quot; || cladding_c == &amp;quot;Plastered&amp;quot;} &lt;/code&gt;(and likewise for the other condition with || in your example)&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;As a side note, you should also only use straight quotes, not &amp;quot;smart quotes&amp;quot; that some word processors use. It appears that you are using straight quotes in your example, but I thought I&amp;#39;d mention it just in case!&lt;/p&gt;
&lt;p&gt;If you make those changes, does that clear up the unexpected output?&lt;/p&gt;
&lt;p&gt;-Brenda&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>