<p>I'm trying to create my config map in helm using the following code:</p>
<pre><code> api: &quot;{{ .Values.global.api }}&quot;,
 demo: {{ .Values.global.api | contains &quot;demo&quot; }},
 other: ....,
</code></pre>
<p>I would like to set <code>other</code> as true if Values.global.api NOT contains &quot;demo&quot; and &quot;prod&quot;.
Something like</p>
<pre><code>other: {{ .Values.global.api | NOT (contains &quot;demo&quot; AND contains &quot;prod&quot;) }},
</code></pre>

Fabry
<p>In the Go <code>text/template</code> language, pipelines and function calls are equivalent and you can freely substitute in either direction</p>
<pre><code>{{ x | f a b }}
{{ f a b (x) }}
</code></pre>
<p>You can't distribute a parameter across multiple functions as you're suggesting here; you need to repeat it (or put it into a local variable).  Looking through the catalog of <a href="http://masterminds.github.io/sprig/" rel="nofollow noreferrer">Sprig</a> functions, I'm not sure there's any specific function that matches your needs that would make this simpler.  You have to spell it out:</p>
<pre><code>demo: {{ not (and (contains &quot;demo&quot; .Values.global.api) (contains &quot;prod&quot; .Values.global.api)) }}
</code></pre>
<p>As I parenthetically suggested, you can use a local variable to shorten this a little:</p>
<pre><code>{{- $api := .Values.global.api }}
api: {{ quote $api }}
demo: {{ not (and (contains &quot;demo&quot; $api) (contains &quot;prod&quot; $api)) }}
</code></pre>
