Skip to main content
A Set value step writes a calculated Embedded Data field as the respondent moves through the survey. Its value comes from an expression, for example round(@q1 + @q2 * 2) for a score, concat("segment-", @plan) for auto-coding, or daysBetween(@signup_date, now()) for days since a date. You add and edit Set value steps on the Flow tab.

Adding a step

Under a block on the Flow tab, open Add logic and choose Set value. The new step always runs after the block is submitted, and reads Always on the outline. A new step starts with Expression off, on Assign: choose the calculated field to set and the value it gets, a typed value, an answer or another field. Switch on Expression to work the value out with an expression instead. To set the value only for some respondents, use Add a condition on the step: it then runs only when the condition matches. Removing the condition makes it always run again. With Expression off, a step reads field, operator and value, such as score + 1. For a number field, the operator list shows each operator with its symbol: Add, Subtract, Multiply, Divide and Assign. For a text field it offers Assign and Append, which adds the value to the end of the field’s text; the outline reads it as append “-vip” to segment. A Set value step with Expression off: score, its operator list open with Add, Subtract, Multiply, Divide and Assign, and the value 1 To turn a one-step calculation into an expression, switch on Expression in its row. Switching it off turns an expression back into one step when it is one, such as ifEmpty(@score, 0) + 1; any other expression is cleared after you confirm. Changing an existing action to Set value starts it on Assign with Expression off, like a new step.

Writing an expression

  • Numbers and text. Type numbers as they are (2, 1.5) and put text in quotes ("gold"). A date in quotes, such as "2026-03-01", counts as a date where a date is expected.
  • Answers and fields. Type @ or use the @ button to insert an answer or a field. Questions are named by their question code, Embedded Data fields by their name, and auto-captured fields such as language by theirs. A name with spaces is written in braces: @{Plan tier}.
  • Operators. +, -, * and / work as in a calculator, with * and / first. Use brackets to change the order.
  • Functions. Click a function chip to insert it, or type its name.
Below the expression, the box shows what a save would refuse, or the sample result: what the step computes for a made-up response with a typical answer to every question. A Set value step that always runs: fee_score is set to round(ifEmpty(@fee_clarity, 0) * 20), with the function chips below the expression and the sample result If @fee_clarity is 4, the result is 80

What an answer is in an expression

Other question types can’t be used in an expression. An Embedded Data field has the type you gave it.

Functions

Empty values

  • Empty in, empty out. When a question wasn’t answered or a field isn’t set, an expression that uses it is empty. Use ifEmpty to set a default: ifEmpty(@q1, 0) + 1.
  • Dividing by zero gives empty.
  • A value that isn’t a number counts as empty where a number is needed.
  • Setting a field to empty clears it, so the response doesn’t keep an old value.
One-step calculations keep their old behaviour: there, an empty field counts as 0.

Dates

A calculated field can be a date. Set it with now() to record when the respondent reached a step, and use it in daysBetween() to count days, for example the days since a date passed in a URL parameter. Dates are stored as ISO 8601 timestamps in UTC, and they appear in exports like every other field. With the Expression switch off, a date field is set to a date picked from the calendar, a date question’s answer, or another date field. Anything more, such as now() or a date worked out with a function, needs the expression box. The calendar next to the expression box writes a picked date in quotes, such as "2026-11-05", into the expression. A Set value step with Expression off that sets the date field fee_review_requested_on to a picked date, Nov 13, 2026 daysBetween() counts calendar days in UTC, not 24-hour periods: from 23:59 to 00:01 the next day is one day.

Checks when you save

An expression is checked when you save or publish the survey. It is refused, with the exact place marked, when:
  • it uses text where a number is needed, such as an open text answer in +
  • a function gets the wrong number of values, or a function doesn’t exist
  • it names a question or field the survey doesn’t have
  • its result doesn’t fit the field: a number field takes a number, a text field text, a date field a date
  • it nests deeper than 12 levels or has more than 200 parts

Through the API

The Management API and MCP store the same expression as a tree, which is what the survey runs. A Set value step is a calculate action with operator: "assign" and an expression value:
A step that always runs is a rule whose conditions is an empty and group. The survey evaluates expressions without eval, so they work on websites with a strict Content Security Policy.

While upgrading a self-hosted instance

During a rolling upgrade to 6.2, the pods still on the previous release don’t know three things a survey saved in that window may hold, and reject the survey wherever they validate it until the upgrade ends:
  • a Set value step with an expression (the expression value)
  • a Mark response as Low quality action
  • a condition on a calculated date field, even one set only by its default value: the previous release looks the field up in the older variables list, which doesn’t list date fields
Only surveys saved with one of these during the upgrade are affected, and only for its few minutes. Everything else 6.2 adds, such as show-if, Hidden options, copied options and rules before the first question, is ignored by the previous release and shown as before.