Skip to content

Cannot save checkbox prompts as attributes #27014

Open

Description

@filips123

Describe the bug

It is not (easily?) possible to store a checkbox prompt value as a user attribute. The first problem seems to be that the backend returns the initial value as Python's True or False, but the frontend treats both as strings, so the checkbox is always set as checked. The second problem is that when the checkbox is unchecked, it is not even sent in the user-settings query, so the later User Write Stage does nothing and keeps the attribute enabled. And when it is checked, it seems it's saved as a string on rather than boolean.

This first problem happens when the initial value expression is set to:

return user.attributes.get("passwordless_login", False)

The same also happens with:

return "on" if user.attributes.get("passwordless_login") else "off"

I also tried a few other initial values, like

return True if user.attributes.get("passwordless_login") else ""

This one solves the issue of checkbox being checked when attribute is not true, but it still has the problem of not saving the result when unchecked.

How to reproduce

  1. Create a boolean attribute passwordless_login on the user object.
  2. Create a checkbox prompt user-settings-field-passwordless-login with field key attributes.passwordless_login and initial value from above, with initial value as expression enabled.
  3. Add this prompt to the default-user-settings stage.

Expected behavior

It should correctly store the attribute value as true or false, depending on whether the checkbox is checked.

Screenshots

No response

Additional context

Might be a similar issue as #12758 or #10445.

Deployment Method

Docker

Version

2026.8.4

Relevant log output

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

Projects

Relationships

None yet

Development

No branches or pull requests

Issue actions