-
Notifications
You must be signed in to change notification settings - Fork 31
Labels
area/logicrelated to logic/dynamics/expressionsrelated to logic/dynamics/expressionsfeature-completeFeatures needed for parity with Altinn 2 (target: June 2023)Features needed for parity with Altinn 2 (target: June 2023)kind/feature-requestNew feature or requestNew feature or request
Description
Extracted from #646.
We should implement some new simple functions in the expression language. All of these implementations should be fairly easy, but if any of these presents problems during the implementation phase, new issues should be created for them specifically.
List of functions we need:
-
round- Rounds a number to an integer, or optionally a decimal with a configurable amount of decimal points
-
text- Should look up a value from a text resource, or from a language key. Additional arguments should be considered parameters to the text resource, if any are provided. Returns
stringornull
- Should look up a value from a text resource, or from a language key. Additional arguments should be considered parameters to the text resource, if any are provided. Returns
-
strLength/stringLength/numCharacters- Function taking a sting as an argument and returns the number for characters in the string (note: the number of characters is not the same as the number for bytes)
-
language- Function with no parameters, returns the currently selected language (i.e.
nb,en, etc).
- Function with no parameters, returns the currently selected language (i.e.
-
contains- String-checking function to check if the second parameter (a
string) is inside the first parameter (also astring)
- String-checking function to check if the second parameter (a
-
notContains- Synonym for
["not", ["contains", ...]]
- Synonym for
-
endsWith- String-checking function to check if the first parameter ends with the string in the second parameter
-
startsWith- Same as the above, but for the beginning of the text
-
commaContains- Special function for checking if a value is included in a comma-separated list of strings.
- Can also be represented as a shortcut to
["or", ["equals", string, input], ["startsWith", string, ["concat", input, ","]], ["endsWith", string, ["concat", ",", input]], ["contains", string, ["concat", ",", input, ","]]]
-
displayValueCreated a separate issue- Looks up a component nearby, and presents its display value (which should work for number-formatted Input fields). See comment here: As an app developer I want to show the display value as a variable in text #1105 (comment)
-
upperCase- Takes a string, turns it into UPPERCASE
-
lowerCase- Takes a string, turns it into lowercase
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
area/logicrelated to logic/dynamics/expressionsrelated to logic/dynamics/expressionsfeature-completeFeatures needed for parity with Altinn 2 (target: June 2023)Features needed for parity with Altinn 2 (target: June 2023)kind/feature-requestNew feature or requestNew feature or request
Type
Projects
Status
✅ Done