<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Using Jinja variables in the Template Editor in Controllers</title>
    <link>https://community.cisco.com/t5/controllers/using-jinja-variables-in-the-template-editor/m-p/4489559#M44</link>
    <description>&lt;P&gt;I worked out the problem (other than being a newbie), the reason this isn't working is because of the brackets I had on the variable.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;{% set building = 'YAB' %}&lt;BR /&gt;Building is {{ building }}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;{% if 'YAB' == &lt;STRONG&gt;building&lt;/STRONG&gt; %}&lt;BR /&gt;Right Building&lt;BR /&gt;{% else %}&lt;BR /&gt;Wrong Building&lt;BR /&gt;{% endif %}&lt;/P&gt;</description>
    <pubDate>Thu, 21 Oct 2021 01:34:30 GMT</pubDate>
    <dc:creator>CjD2018</dc:creator>
    <dc:date>2021-10-21T01:34:30Z</dc:date>
    <item>
      <title>Using Jinja variables in the Template Editor</title>
      <link>https://community.cisco.com/t5/controllers/using-jinja-variables-in-the-template-editor/m-p/4488905#M43</link>
      <description>&lt;P&gt;When setting a variable that I want to use else where in a Jinja template, I find it does not seem to work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example, the simple script below compares the building name provided in a variable.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;{% set building = 'YAB' %}&lt;BR /&gt;Building is {{ building }}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;{% if 'YAB' == "{{ building }}" %}&lt;BR /&gt;Right Building&lt;BR /&gt;{% else %}&lt;BR /&gt;Wrong Building&lt;BR /&gt;{% endif %}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The answer is always Wrong Building, it is as though the if statement cannot read variables, even though my testing statement at the beginning produces the Right building name.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there something I am missing regarding using variables?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 20 Oct 2021 22:33:19 GMT</pubDate>
      <guid>https://community.cisco.com/t5/controllers/using-jinja-variables-in-the-template-editor/m-p/4488905#M43</guid>
      <dc:creator>CjD2018</dc:creator>
      <dc:date>2021-10-20T22:33:19Z</dc:date>
    </item>
    <item>
      <title>Re: Using Jinja variables in the Template Editor</title>
      <link>https://community.cisco.com/t5/controllers/using-jinja-variables-in-the-template-editor/m-p/4489559#M44</link>
      <description>&lt;P&gt;I worked out the problem (other than being a newbie), the reason this isn't working is because of the brackets I had on the variable.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;{% set building = 'YAB' %}&lt;BR /&gt;Building is {{ building }}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;{% if 'YAB' == &lt;STRONG&gt;building&lt;/STRONG&gt; %}&lt;BR /&gt;Right Building&lt;BR /&gt;{% else %}&lt;BR /&gt;Wrong Building&lt;BR /&gt;{% endif %}&lt;/P&gt;</description>
      <pubDate>Thu, 21 Oct 2021 01:34:30 GMT</pubDate>
      <guid>https://community.cisco.com/t5/controllers/using-jinja-variables-in-the-template-editor/m-p/4489559#M44</guid>
      <dc:creator>CjD2018</dc:creator>
      <dc:date>2021-10-21T01:34:30Z</dc:date>
    </item>
  </channel>
</rss>

