PDF Generator API
Go to website
Back
Articles on:Expression language
The expression language allows writing a mathematical and logical expression to manipulate the value displayed by component.

Categories

  • Developer
  • Expression language
  • Components
  • Q&A
  • Integrations
  • Release notes
  • What is Expression Language?
    Expression language in PDF Generator API is a specific programming language that allows writing mathematical and logical expression to manipulate the value displayed by component. Example expressionPopular
  • Supported operators
    Arithmetic Operators + (Addition) - (Subtraction) * (Multiplication) / (Division) % (Modulus) (Pow) Logical Operators ! (not) && (And) (Or)Popular
  • Functions
    Number functions Format number Format a number with grouped thousands and optionally decimal digits. Round Round the float number based on the precision from the second parameter. Ceil Rounds to the nearest integer up. E.g. 2.1 =3. Floor Rounds to the nearest intPopular
  • Common use-cases of the Expression language
    Using Filter and Iterate function Let's say you have an array of line items, where items can be of different type (e.g. "Food", "Drinks", etc...) and you need to get a SUM of a specific type. Then you can do it using a combination of filter and iterate function: % sum(iterate(filter( lineitems , 'type == "Drinks"'),'totalprice')) % Example JSON dataset:Popular
  • Number Functions
    Format number Format a number with grouped thousands and optionally decimal digits. Round Round the float number based on the precision from the second parameter. Ceil Rounds to the nearest integer up. E.g. 2.1 =3. Floor Rounds to the nearest integer down. E.g. 2.8 =>Some readers
  • String functions
    Uppercase To display data field value in uppercase, use following expression. Lowercase To display data field value in lowercase, use following expression. Capitalize Uppercase the first character of each word in a string. Split The split(delimiter, string) function allows to split string into an array.Popular
  • List (array) functions
    Count It is possible to count number of items in list. Max Returns maximum value of list of elements or separate field values. or Min Returns minimum value of list of elements or separate field values. orPopular
  • Date functions
    Date Format date value. Examples of the function "Date": Display current time Specify timezone Specify output format Specify output and input format Datetime Format datetime value.Some readers
  • Utility functions
    Empty The empty(value) checks if the variable exists and if the value is not “falsy”. Returns true if var does not exist or has a value that is empty or equal to zero, aka falsely. Otherwise, it returns false. What qualifies as "falsy"? Anything that returns false if cast to boolean Empty array Zero as number Zero as string Empty string null false undefined JSON decode Decode JSON string to usSome readers

Not finding what you are looking for?

Chat with us or send us an email.

  • Chat with us
  • Send us an email
© 2025 PDF Generator API