Hi all,
I would like to replace text with variables from the current row like the functionality in template variables (without using a lot of substitutes).
e.g.:
Text in a field: โyour order <<[Order Number]>>โฆโ and the variable <<[Order Number]>> should be replaced with the value from the column [Order Number].
This should work with any column field and not only with predefined substitute expressions.
Hope there is a solution?
Thank you very much, Joachim
What about CONCATENATE ?
CONCATENATE(โYour order ",[Order Number]," is available here")
or, alternatively:
โYour order " & [Order Number] & " is available here")
For reference:
Thank you,
I have template texts in a separate table which someone can choose and they are copied in another field.
These text strings should be able to contain variables which will be filled during the process of copiy.
Thus concatenate is not usable in this context.
OK, so you may want to display some sort of enum to the user, and set a value that will be saved depending on this enum value.
For example, letโs say you have an enum field [myEnumChoice] having โchoice1โ, โchoice2โ, choice3".
Then, your expression in the [outputResult] column could be:
SWITCH([myEnumChoice],
"choice1", "yourTextWithConcatenationExpression_1",
"choice2", "yourTextWithConcatenationExpression_2",
"choice3", "yourTextWithConcatenationExpression_3",
"yourTextWithConcatenationExpression_Default"
)
For reference:
If that still does not help you, you may want to provide further context
could not be read from a table with template text values.
Although the example can only process one choice in a sentence (text template)
Ok, I think I understand. You want the actual text stored in the table to contain the references to the column names so that when that column value is applied - the referenced column name is replaced with the value from the column.
AppSheet does not support this as of now.
Yes @WillowMobileSystems that is exact what I want.
An โINDIRECTโ function could solve this but is not available.
The only solution I actually have is a cascaded SUBSTITUTE if I have a list of possible fields, which is not dynamic. If someone add e.g. [field3] I have to add a new substitute function.
SUBSTITUTE(
SUBSTITUTE(
SUBSTITUTE([field], โ{field1}โ, [field1]),
โ{field2}โ, [field2]),
โ{field3}โ, [field3])
)
etcโฆ
SUBSTITUTE is ok, but as you sad you need to add new one for every new value. SUBSTITUTE also breaks formatting, example new rows.
Hello, maybe it can help you something like this...
User | Count |
---|---|
19 | |
10 | |
7 | |
5 | |
5 |