# \#templating

**URL:** https://community.replicated.com/tag/templating/20.md

[Latest](https://community.replicated.com/latest.md) · [Categories](https://community.replicated.com/categories.md) · [Tags](https://community.replicated.com/tags.md)

---

## [Show/hide fields in the KOTS Config based on deployment t-shirt size](https://community.replicated.com/t/show-hide-fields-in-the-kots-config-based-on-deployment-t-shirt-size/1432)

<div class="topic-metadata">

**Author:** [@Paige\_Calvert](https://community.replicated.com/u/Paige_Calvert)\
**Replies:** 0\
**Last updated:** [July 31, 2024, 8:04pm UTC](https://community.replicated.com/t/show-hide-fields-in-the-kots-config-based-on-deployment-t-shirt-size/1432 "2024-07-31T20:04:41Z")

</div>

It’s often necessary to have different sets of default values and/or fields in the KOTS Config based on the size of the deployment. For example: Less than 100 users = Small Deployment configs 101-500 users = Medium De…

---

## [How to: use a logical \`and\` to evaluate a conditional expression mixed with config and license value](https://community.replicated.com/t/how-to-use-a-logical-and-to-evaluate-a-conditional-expression-mixed-with-config-and-license-value/1380)

<div class="topic-metadata">

**Author:** [@Dexter\_Yan](https://community.replicated.com/u/Dexter_Yan)\
**Replies:** 0\
**Last updated:** [February 23, 2024, 2:45am UTC](https://community.replicated.com/t/how-to-use-a-logical-and-to-evaluate-a-conditional-expression-mixed-with-config-and-license-value/1380 "2024-02-23T02:45:44Z")

</div>

Currently, we only have ConfigOptionEquals function for config value check. To use a and to evaluate a conditional expression mixed with license bool value like repl{{ and (LicenseFieldValue "\<LICENSE\_FIELD\_NAME :: boo…

---

## [How do I build a database connection string using KOTS Config templates?](https://community.replicated.com/t/how-do-i-build-a-database-connection-string-using-kots-config-templates/1122)

<div class="topic-metadata">

**Author:** [@ravi\_devarakonda](https://community.replicated.com/u/ravi_devarakonda)\
**Replies:** 2\
**Last updated:** [February 8, 2023, 7:20pm UTC](https://community.replicated.com/t/how-do-i-build-a-database-connection-string-using-kots-config-templates/1122 "2023-02-08T19:20:08Z")

</div>

I have a use case where based on the type of database selected, the connection string needs to be built differently. For example: items: - name: db\_type title: Database type type: select\_one …

---

## [How Can I Automatically Detect the Kubernetes Distribution?](https://community.replicated.com/t/how-can-i-automatically-detect-the-kubernetes-distribution/906)

<div class="topic-metadata">

**Author:** [@Fernando\_Cremer](https://community.replicated.com/u/Fernando_Cremer)\
**Replies:** 3\
**Last updated:** [October 24, 2022, 1:53pm UTC](https://community.replicated.com/t/how-can-i-automatically-detect-the-kubernetes-distribution/906 "2022-10-24T13:53:49Z")

</div>

I want to be able to detect the Kubernetes distribution where the application is being deployed to so I can automatically only show Config fields that apply to the distribution. I also want to be able to only run specifi…

---

## [Template function to convert ConfigOption value into yaml](https://community.replicated.com/t/template-function-to-convert-configoption-value-into-yaml/985)

<div class="topic-metadata">

**Author:** [@jdewinne](https://community.replicated.com/u/jdewinne)\
**Replies:** 0\
**Last updated:** [September 22, 2022, 4:21pm UTC](https://community.replicated.com/t/template-function-to-convert-configoption-value-into-yaml/985 "2022-09-22T16:21:13Z")

</div>

If I have several ConfigOption values, and I combine them into a hidden ConfigOption, is there an easy way to convert the combined value into yaml. A bit like the sprig toJson function but in this case it would have to b…

---

## [How to: use a logical \`and\` to evaluate a conditional expression in a Config template](https://community.replicated.com/t/how-to-use-a-logical-and-to-evaluate-a-conditional-expression-in-a-config-template/614)

<div class="topic-metadata">

**Author:** [@adamancini](https://community.replicated.com/u/adamancini)\
**Replies:** 1\
**Last updated:** [February 1, 2022, 4:07pm UTC](https://community.replicated.com/t/how-to-use-a-logical-and-to-evaluate-a-conditional-expression-in-a-config-template/614 "2022-02-01T16:07:07Z")

</div>

How do I display a Config option only when two or more other items are True or False? I tried when: repl{{ ConfigOptionEquals "option\_one" "0" }} & repl{{ ConfigOptionEquals "option\_two" "0" }} but this isn’t working…

---

## [How Can I Check If a File Has Been Uploaded?](https://community.replicated.com/t/how-can-i-check-if-a-file-has-been-uploaded/669)

<div class="topic-metadata">

**Author:** [@Fernando\_Cremer](https://community.replicated.com/u/Fernando_Cremer)\
**Replies:** 0\
**Last updated:** [January 18, 2022, 2:19pm UTC](https://community.replicated.com/t/how-can-i-check-if-a-file-has-been-uploaded/669 "2022-01-18T14:19:29Z")

</div>

One of the field types available in KOTS’ Config Kind is a file. This allows the end user to upload the file, and the application is able to consume the contents via our templating. But, what if you want to check if the…
