← Expressions & logic

Overview of expression functions

Last updated November 4, 2026

In the expression editor, the Functions tab lists every function, sorted into five groups. This page says what each function does and which values it needs. Unlike in the tab, the groups here are not in alphabetical order but in order of how often you need them: Logic first, Animation last. How to insert a function is explained in Use the expression editor.

You write functions in capitals, with the values after them in brackets, separated by commas: MAX(10, 20). Text and colors go in backticks: `#0050ff`. In the list below, the brackets hold placeholders. Put your own values there.

Functions tab with the groups Animation, Color, Helpers, Logic and Math; Math is open.

Logic

For IF, NOT, AND and OR, false, empty text and missing values count as false. Everything else counts as true, including the number 0.

  • IF(condition, then, else): returns then if condition is true, otherwise else. For example, IF(BIGGER(price, 100), 10, 0) gives 10 if price is greater than 100, otherwise 0.
  • SWITCH(value, case1, result1, case2, result2, …, default): compares value with the cases in turn and returns the result of the first case that is equal. If none matches, it returns default. Never leave out default: without it, SWITCH does not check the last case.
  • BREAKPOINTS(value, start, limit1, result1, limit2, result2, …): returns the result of the highest limit that value reaches. If value is below all limits, it returns start. Put the limits in ascending order. BREAKPOINTS(headline.width, 60, 300, 48, 600, 36) gives 60 below 300 pixels of width, 48 from 300 and 36 from 600.
  • EQUAL(a, b): true if a and b are exactly the same. The number 5 and the text `5` are not the same.
  • BIGGER(a, b): true if a is greater than b.
  • BIGGEREQUAL(a, b): true if a is greater than or equal to b.
  • SMALLER(a, b): true if a is less than b.
  • SMALLEREQUAL(a, b): true if a is less than or equal to b.
  • NOT(value): true if value is false, and the other way round.
  • AND(a, b, …): true if all values are true.
  • OR(a, b, …): true if at least one value is true.
  • IS_EMPTY_STRING(value): true if value is an empty text. A text made of spaces is not empty.
  • PROJECT_STATE(combinations, seed): for advanced users. combinations is a list of lists of variants. The function builds every possible combination from them and picks one with seed, a number from 0 to 1. The result holds the values of the chosen variants.

Helpers

  • QR_CODE(text): returns the address of a QR code image for text, 150 × 150 pixels. Use it as the image of an image element, for example QR_CODE(website).
  • FLATTEN_LIST(list, path): takes the same value from every entry of a list. FLATTEN_LIST(team, `name`), for example, gives all names of a collection team.
  • ELEMENT(name, number, …): reads one copy of an element that repeats with Iteration. The first copy has the number 0. If the repetition sits inside another one, the name and number of the inner repetition follow: ELEMENT(`group1`, 0, `text1`, 2).
  • FIND_DUPLICATE(name, number): reads the element or variable named name_number. FIND_DUPLICATE(`photo`, 2), for example, reads photo_2. Without number, it reads name itself.
  • GET_FEATURES(text): returns the single pieces of a text's lines with their font and measurements, for example GET_FEATURES(headline).
  • ITERATE_PATH_FEATURES(type, count, function): creates count points of a path of the kind type, for example `line`. function works out the coordinates of each point from its number, starting at 0: ITERATE_PATH_FEATURES(`line`, 5, (i) => ({ x: i * 40, y: 0 })).

Math

The calculating functions also take lists and read numbers from text: `20px` counts as 20.

Calculating:

  • ADD(a, b, …): adds all values.
  • SUB(a, b, …): subtracts all further values from a.
  • MULT(a, b, …): multiplies all values.
  • DIV(a, b, …): divides a by all further values.
  • POW(a, b): a to the power of b.
  • SQRT(a): the square root.
  • CBRT(a): the cube root.
  • ABS(a): the absolute value, so the number without a minus.
  • SIGN(a): -1 for negative numbers, 1 for positive ones, 0 for 0.
  • EXP(a): e to the power of a.
  • LOG(a, base): the logarithm of a to base. Without base, the natural logarithm.

Rounding: for normal rounding, use FLOOR(a + 0.5).

  • CEIL(a): rounds up. CEIL(3.2) gives 4.
  • FLOOR(a): rounds down. FLOOR(3.7) gives 3.
  • TRUNC(a): cuts off the decimals. TRUNC(-3.7) gives -3.

Statistics and chance:

  • MAX(a, b, …): the largest value. MAX(10, 20) gives 20.
  • MIN(a, b, …): the smallest value.
  • MEAN(a, b, …): the average.
  • MEDIAN(a, b, …): the middle value. Give the numbers one by one, not as a list.
  • RANDOM(min, max): a random number between min and max. With only one value, it lies between 0 and that value, without values between 0 and 1. It changes with every new calculation.

Converting values:

  • PROJECT(x, a1, a2, b1, b2): converts x from the range a1 to a2 into the range b1 to b2. Values outside end up at the edge. PROJECT(50, 0, 100, 0, 1) gives 0.5.
  • PROJECT_TO_UNIT_INTERVAL(x, a1, a2): converts x from the range a1 to a2 into the range 0 to 1.
  • PROJECT_FROM_UNIT_INTERVAL(x, a1, a2): converts x from the range 0 to 1 into the range a1 to a2.

Angles: these functions work in radians, not degrees. 180 degrees are 3.14159.

  • SIN(a), COS(a), TAN(a): sine, cosine and tangent.
  • ASIN(a), ACOS(a), ATAN(a): the inverse functions. They return an angle.
  • ATAN2(y, x): the angle to the point with the coordinates x and y. Note that y comes first.
  • SINH(a), COSH(a), TANH(a), ASINH(a), ACOSH(a), ATANH(a): the hyperbolic functions and their inverses.

Color

All color functions take a color as text, for example `#0050ff`. Most of them return a new color as a hex code.

amount is a share from 0 to 1 and changes relative to the current value: COLOR_LIGHTEN(color, 0.2) raises the lightness by 20 % of its current value. A value that is 0 therefore stays 0. Black, for example, does not get lighter with COLOR_LIGHTEN.

Lightness and saturation:

  • COLOR_LIGHTEN(color, amount): makes the color lighter.
  • COLOR_DARKEN(color, amount): makes the color darker.
  • COLOR_LIGHTNESS(color, value): sets the lightness to value. 0 is black, 0.5 the full color, 1 white.
  • COLOR_SATURATE(color, amount): makes the color stronger.
  • COLOR_DESATURATE(color, amount): makes the color paler.
  • COLOR_SATURATION(color, value): sets the saturation to value, from 0 (gray) to 1 (full).
  • COLOR_GRAYSCALE(color): turns the color into a gray.
  • COLOR_WHITEN(color, amount): raises the share of white.
  • COLOR_BLACKEN(color, amount): raises the share of black.

Hue, channels and opacity:

  • COLOR_ROTATE(color, degrees): turns the hue by degrees on the color wheel. 180 gives the opposite color.
  • COLOR_NEGATE(color): inverts the color. White becomes black.
  • COLOR_RED(color, value), COLOR_GREEN(color, value), COLOR_BLUE(color, value): set the red, green or blue part to value, from 0 to 255.
  • COLOR_FADE(color, amount): makes the color more transparent. 0.5 halves its opacity.
  • COLOR_OPAQUE(color, amount): makes a transparent color more opaque.

Values from a color:

  • COLOR_CONTRAST(color1, color2): the contrast between two colors, from 1 (same lightness) to 21 (black on white).
  • COLOR_IS_DARK(color): true if the color is dark.
  • COLOR_IS_LIGHT(color): true if the color is light.
  • COLOR_WHITE(color): the share of white in the color, from 0 to 100.
  • COLOR_BLACK(color): the share of black in the color, from 0 to 100.

Example: IF(COLOR_IS_DARK(brandColor), `#ffffff`, `#000000`) makes a text on a dark brand color white, otherwise black.

Animation

Values that change over time in a video. The current time in seconds is in the value TIME. You find it in the Variables tab.

  • ANIMATE(time, keyframe1, keyframe2, …): works out the value at the moment time from the keyframes. For time you use TIME, the time variable of the video. Before the first keyframe, its value applies. After the last one, the value of the last one applies.
  • LINEAR(time, value): a keyframe. At the moment time, the property has the value value. From the previous keyframe up to this one, it changes evenly.
  • CUBIC(time, value, x1, y1, x2, y2): a keyframe with a curved transition. x1, y1, x2 and y2 are the two control points of the curve. x1 and x2 lie between 0 and 1.

Example: ANIMATE(TIME, LINEAR(0, 0), LINEAR(1, 100)) rises from 0 to 100 in the first second.