Role_Id
Role_Id is a numeric system variable that identifies each participant in a multi-user study. It exists only once a study has been transformed into a multi-participant study (see Multi User Study in Settings); a standard single-participant study has no use for it.
Purpose
A multi-user study can involve two or more participants in the same running session, but by default every participant's experiment runs as an identical, undifferentiated copy of the others. Nothing distinguishes one participant from another until something explicitly does. Role_Id is that distinction: it gives every participant in the session a stable identity that event logic can act on, without collecting anything personal. It carries no name, no browser fingerprint, and no other identifying detail, only a number.
How it's assigned
As participants join a multi-user session, each one without a predefined role receives a Role_Id in ascending order, starting at 1, in the order they connect. A predefined link can also pin a specific Role_Id to that link, in which case assignment is fixed by which link a participant used rather than by connection order.
How it's used
Role_Id is read inside a Requirement Action, the same If/Then conditional logic used throughout the event system, to branch behavior by participant. A common pattern:
- If
Role_Idequals1, show one set of content, for example a target image and a text input. - If
Role_Idequals2(or, using an Else Case, anything other than1), show a different set, for example a set of candidate images and no target.
This is the mechanism behind multi-user designs where each participant plays a different part in the interaction, one participant proposing and another responding, one describing and another guessing, or any study where roles need to differ. Which Role_Id maps to which role is decided when the study is built; the underlying study logic works the same regardless of which number ends up assigned to which role.
Role_Id only distinguishes participants. It does not, by itself, move any information between them, that is the job of the Distribute Variable action. See Building a Multi-user Study for a full walkthrough combining Role_Id with Distribute Variable and frame synchronization into working multi-user patterns.
FAQ
Does Role_Id stay the same across the study?
Yes. Role_Id is a session-scoped variable: it is assigned once, when a participant is matched into a session, and is never reassigned for the rest of that session.
Can a participant's role change partway through a study?
Not directly, there is no mechanism to reassign Role_Id once it's set. If a design needs a role to appear to change over time, for example alternating who proposes in a turn-based game, track that separately with your own variable (a counter, or a value read from a data frame), and combine it with Role_Id in your Requirement Action conditions, rather than expecting Role_Id itself to change.
Further Reading
Multi-user Experiment Design
When to use a multi-user design, best practices, and a gallery of existing examples built in Labvanced.
Building a Multi-user Study
A step-by-step walkthrough using Role_Id inside a Requirement Action to assign different content per participant.
System Variables
What system variables are as a category, Role_Id among them, and where the full reference table lives.