# Result conditional changed on preview and export

**URL:** <https://community.silverfin.com/t/result-conditional-changed-on-preview-and-export/1488>\
**Category:** Templates\
**Created:** [May 21, 2019, 12:25pm UTC](https://community.silverfin.com/t/result-conditional-changed-on-preview-and-export/1488 "2019-05-21T12:25:24Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Panagiotis\_Issaris](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.silverfin.com/panagiotis_issaris/32/1138_2.png) [@Panagiotis\_Issaris](https://community.silverfin.com/u/Panagiotis_Issaris)\
**Post date:** [May 21, 2019, 12:25pm UTC](https://community.silverfin.com/t/result-conditional-changed-on-preview-and-export/1488/1 "2019-05-21T12:25:24Z")

</div>

Hi Silverfin,

When previewing a template the result of a conditional changes, and the same happens when we export the template to PDF.

```
 {% if bezoldiging_zaakvoerder_multiple %}
 werden 
 {% else %}
 werd
 {% endif %}

```

In the document:  
 ![Screenshot%20from%202019-05-21%2014-19-13](https://canada1.discourse-cdn.com/flex030/uploads/getsilverfin/original/1X/38d2acb4322b6dac6dfe971626e2fcd14d7de903.png)

When using “Acties-\>Voorbeeldweergave”:  
 ![Screenshot%20from%202019-05-21%2014-19-31](https://canada1.discourse-cdn.com/flex030/uploads/getsilverfin/original/1X/36a653eaf52816e0c833d221e691f76467c7a022.png)

In the exported PDF:  
 ![Screenshot%20from%202019-05-21%2014-19-56](https://canada1.discourse-cdn.com/flex030/uploads/getsilverfin/original/1X/5d2f1787cff407261eea94f2c3a2b85f43b91846.png)

I’ve tried changing the condition intro a == true, but this didn’t make any difference.  
Furthermore I’ve tried removing all spaces as this was recommended to me for a different problem we had earlier, but to no avail.

With friendly regards,  
Takis

---

<div class="post-metadata">

**Author:** ![Kimberly\_Vlietinck](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.silverfin.com/kimberly_vlietinck/32/1496_2.png) [@Kimberly\_Vlietinck](https://community.silverfin.com/u/Kimberly_Vlietinck)\
**Post date:** [May 22, 2019, 8:43am UTC](https://community.silverfin.com/t/result-conditional-changed-on-preview-and-export/1488/2 "2019-05-22T08:43:08Z")

</div>

Hi @Panagiotis_Issaris,

Can you paste the entire code for that part here? The if-statement you pasted looks OK, so this might be related to another part of your code and the use of inputcomments `{% ic %}{% endic %}`.

Kind regards,  
Kimberly

---

<div class="post-metadata">

**Author:** ![Michiel](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.silverfin.com/michiel/32/2364_2.png) [@Michiel](https://community.silverfin.com/u/Michiel)\
**Post date:** [May 27, 2019, 12:50pm UTC](https://community.silverfin.com/t/result-conditional-changed-on-preview-and-export/1488/3 "2019-05-27T12:50:49Z")

</div>

Dear Takis,

If you notice differences in input and export mode, a good first step is to check whether the condition is still met in export mode. Since the variable _bezoldiging\_zaakvoerder\_multiple_ is only assigned within IC comments, that variable will always be blank in export mode.

```auto
{% ic %}
  {% assign bezoldiging_zaakvoerder_multiple = true %}
  {% if custom.ic.bezoldiging_zaakvoerder == "zaakvoerder" %}
    {% assign bezoldiging_zaakvoerder_multiple = false %}
  {% elsif custom.ic.bezoldiging_zaakvoerder == "bestuurder" %}
    {% assign bezoldiging_zaakvoerder_multiple = false %}
  {% elsif custom.ic.bezoldiging_zaakvoerder == "werkend vennoot" %}
    {% assign bezoldiging_zaakvoerder_multiple = false %}
  {% endif %}
{% endic %}

```

Regards,

Michiel

---

<div class="post-metadata">

**Author:** ![Panagiotis\_Issaris](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.silverfin.com/panagiotis_issaris/32/1138_2.png) [@Panagiotis\_Issaris](https://community.silverfin.com/u/Panagiotis_Issaris)\
**Post date:** [June 5, 2019, 4:01pm UTC](https://community.silverfin.com/t/result-conditional-changed-on-preview-and-export/1488/4 "2019-06-05T16:01:43Z")

</div>

Dear Michiel,

Thanks for the reply! This indeed solved our problem!

I assumed the following statement implied that text was not being output, but the statements were  
still being processed (and so variables would be set):

> Displaying something in input view and not in export view, can be done with an input comment

With friendly regards,  
Takis

---

<div class="post-metadata">

**Author:** ![sven](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.silverfin.com/sven/32/1495_2.png) [@sven](https://community.silverfin.com/u/sven)\
**Post date:** [June 5, 2019, 4:25pm UTC](https://community.silverfin.com/t/result-conditional-changed-on-preview-and-export/1488/5 "2019-06-05T16:25:24Z")

</div>


