# How do you create a custom multi-select in Adalo?

Create a custom Adalo multi-select with relationships, join records, selected and unselected component states, duplicate protection, and explicit test cases.

- Canonical URL: https://adalocado.com/answers/custom-multi-select
- Verification: Verified from current public evidence
- Topic: Actions and Logic
- Skill level: Intermediate
- Last reviewed: 2026-08-12
- Index status: index-now

## Short answer

Represent selections with a many-to-many relationship or a join collection, then show selected and unselected component states based on whether the current option is related to the current user or parent record.

The saved relationship is the source of truth for a multi-select. Render every option, show selected and unselected controls with opposite visibility conditions, and have those controls add or remove the current option. A join collection is the safer model when the selection itself needs properties or audit history.

## Intended outcome

A selectable list where each option can be independently added or removed and the visual state reflects saved data.

## Requirements

- A collection of selectable options
- A user or parent record that owns the selections
- A relationship or join collection

## Step by step

1. **Choose the data model**

   Use many-to-many for a simple association; use a join collection if each selection needs metadata such as order or quantity.

2. **Render the options**

   Create a list of all selectable records.

3. **Create two visual states**

   Design selected and unselected versions and control them with opposite visibility rules.

4. **Add and remove the relationship**

   The unselected state adds the current option; the selected state removes it.

5. **Verify persistence**

   Leave and return to the screen to confirm visual state comes from saved data rather than temporary UI state.

## Why it works

- The database relationship is the source of truth.
- Opposite visibility rules make the two states appear as one control.
- A join collection is more flexible when the relationship itself needs properties.

## Data model

| Collection | Properties | Relationships |
| --- | --- | --- |
| Users or parent records | Name | Has many selections |
| Options | Label, Sort Order | Can be selected by many parents |
| Selections (optional) | Order, Quantity, Created Date | Joins one parent to one option |

## Common failures

### Both states appear

Make the visibility conditions exact opposites and confirm both components evaluate the same relationship.

### The state resets

Confirm the action updated the relationship or join record rather than only navigating or changing input state.

## Testing checklist

- [ ] Selecting two options persists both relationships after leaving and returning.
- [ ] Removing one selection leaves every other selected option unchanged.
- [ ] Two test users see only the selections associated with their own records.
- [ ] Multiple options can be selected
- [ ] Removing one does not clear others
- [ ] State persists after navigation
- [ ] Logged-in users see only their selections

## Limitations

- Use a join collection when a selection needs quantity, order, notes, or other metadata.

## Community evidence

### [Create record that has multiple relationships](https://forum.adalo.com/t/create-record-that-has-multiple-relationships/53010)

The reply says many-to-many selections are stored by updating an existing record and discusses marketplace or button-and-boolean interfaces. Boundary: The thread reports that the desired database-style multi-select UI is not a built-in front-end form control.

## Sources

- [Adalo relationships](https://help.adalo.com/database/relationships)
- [Adalo component visibility](https://help.adalo.com/component-basics/changing-a-components-visibility)
- [Adalo forum: multiple relationships](https://forum.adalo.com/t/create-record-that-has-multiple-relationships/53010)

Markdown version: https://adalocado.com/answers/custom-multi-select.md
