Description
This article explains how to concatenate texts and how to combine formulas within other formulas to create complex calculations and representations.
Concatenating Texts
Concatenating texts in Smenso is done using the +
operator. Both static texts and dynamic values from fields or formulas can be used.
Syntax
"Text1" + " " + "Text2"
Examples
Simple Text Concatenation:
"Project: " + flavor("ProjectTitle")
Result: If the project title is "Marketing Campaign", this results in: "Project: Marketing Campaign"
Text with Dynamic Values:
flavor("User") + " has spent " + sumAll("Costs", true) + " €."
Result: If the user is "Anna Müller" and the sum of costs is 1500, this results in: "Anna Müller has spent 1500 €."
Multiline Texts with Operators:
"Title: " + flavor("ProjectTitle") + "\n" + "Costs: " + sumAll("Costs", true) + " €"
Result: Displays the title and costs on two separate lines.
Combining Formulas
Smenso supports nesting formulas, allowing other formulas to be used within a formula to create complex calculations.
Examples
sumAll(if(flavor("Category") == "Marketing", Costs, 0), true)
"Status: " + if(flavor("Completed"), "Finished", "Open")
format(if(sumAll("Costs", true) 10000, "Over Budget", "Within Budget"), "", "", if(sumAll("Costs", true) 10000, "red", "green"))
Tips and Notes
- Nesting Formulas: Formulas can be nested within each other to create dynamic and complex calculations.
- Clarity: Use clear and structured formulas to improve readability.
- Testing: Verify functionality by building and testing the formula step by step.
A detailed overview of operators can be found in the article Flavors of Type "Formula" .
Comments
0 comments
Please sign in to leave a comment.