Delete User – deleting a user account from an action¶
The command "Delete User" deletes a user account together with its role assignments. This page is for administrators who build actions that clean up accounts.
1. At a glance¶
| Purpose | Delete a user account |
| Typical use | Removing the accounts of external users after their project has ended |
| Where in the editor | Toolbar menu "Data" → "Delete User" |
| Needs a user interface | Only for "Confirm in UI" |
| Needs a current record | No – but the expression can read it |
| Changes the current record | No |
| Permissions of the running user | "Delete User" |
| Related | Create Or Update User, Users |
2. Settings¶
The settings are on the tab "General", below "Display Name", "Description" and "Execution Condition" (see Actions).
| Setting | Meaning | Default / Required |
|---|---|---|
| "User Identifier" | Expression that returns the id or the user name of the user to delete | Required |
| "Confirm in UI" | Asks the user before deleting | Off |
3. Behaviour¶
- The expression is evaluated against the current record and the variables of the action. If it returns an empty value, the command fails.
- With "Confirm in UI" and a user interface, the dialog "Confirm delete" asks "Do you want to delete the user '…'?". "No" ends the action; nothing is deleted. Without a user interface, nobody is asked and the user is deleted.
- The user with this id is deleted; if no user has this id, the user with this user name. If there is none, or the user the action runs for lacks "Delete User", the command fails and the action ends with an error.
- The user id is removed from the profile record of the user. The profile record itself is not deleted.
- The role assignments of the user are deleted, then the account.
- The deletion takes effect immediately, also while a sketch is open. Unlike deleting in the user manager, it is not collected in the sketch.
4. Examples¶
Removing external users. A scheduled action iterates over the records of the entity "External Partner" whose contract has ended and runs Delete User with "User Identifier" = field "Login". The profile records of the deleted users stay and no longer point to an account.
5. Limitations¶
- There is no undo. If you only want to keep a person out, lock the account with Create Or Update User instead.
- Sessions of the deleted user that are already open are not ended at once.
- Deleting the special administrator account
nxadminhas no lasting effect: nexxcite creates it again at the next start, see Users.