Rancher App (questions.yaml) with multi-line strings

When deploying a Helm App on Rancher, then you can fill each key-value pair as you wish. Each key may, if you wish, contain a multi-line string as valid input for its value.

However, when deploying a Rancher App (with a questions.yaml), then pasted multi-line strings are always de-newlined. All newlines are just trimmed from the input text.

Is this necessary? If yes, why is it necessary? Can this behaviour be changed or omitted? How can I provide multi-line strings as valid answers to the questions in questions.yaml, without the newlines being trimmed?

i’m completely new here and to be honest, i wasn’t even wonder these questions until reading them. if anyone could provide answers that would be great.
maybe you found the answers yourself - please update. thanks

Unfortunately, I am still looking for an answer. I really need to know this, because if it just does not work, I have to implement a feature some other way.

It’s just type: multiline

https://rancher.com/docs/rancher/v2.x/en/catalog/creating-apps/#question-variable-reference

I looked at this so many times. Now I read the entire section and noticed that the reference is in parentheses on the right. I only ever checked out the left side and further information was taking from a questions.yaml I found in another Chart.

Thanks for the clarification.

Well, now the issue is, that backslashes are swallowed during parsing. In my case, it is important that the input is taken literally.

(I haven’t tried so something could actually be wrong, but) The value is going into yaml document, which is going to have to have them escaped. But that doesn’t mean the actual object it represents when deserialized contains \\.

Yes, afterwards I came up with this one, too. I will see what I can achieve with | squote, key: | and the like. Thank you for the support.

A couple of weeks ago, I was trying every possibility to get the multiline string literally from the Helm App to the actual file it is supposed to be put in. All trials failed, even though I was choosing the most literal process for expanding a variable and doing everything as literally as possible during the whole process of setting and finally expanding the variable.
I even resorted to such workarounds:

{{/*
Print expanded value literally.
Call this function like this:
{{ template "printLiteral" (dict "string" .Values.license) }}
*/}}
{{- define "printLiteral" -}}
{{- $string := .string -}}
{{- printf "%s" $string -}}
{{- end }}

and

binaryData:
  license.txt: {{ tpl (.Files.Get (printf "%s%s" .Values.files "license.txt")) . | b64enc -}}

still to no avail.

I don’t know what to do and now this issue has become really urgent and there is a fix needed for this situation. How can I pass a literal string to the Helm App and get the string literally?

The interpretation seems to happen later, possibly the way you suggested, since the problem seems to be connected to converting the value to YAML document.

But I really need this string to stay exactly literal, without any interpretation whatsoever.