> For the complete documentation index, see [llms.txt](https://docs.snapfix.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.snapfix.com/product/features/groups/site-switching.md).

# Switching sites

{% hint style="info" %}
Draft, written by an agent and not yet checked by a person ([how to read these docs](https://docs.snapfix.com/how-to-read.md)). [Source on GitHub](https://github.com/snapfix/docs/blob/main/product/features/site-switching.md).
{% endhint %}

A user who belongs to more than one **site** picks the **current site** with the **site switcher**. The current site decides which groups, tasks, rooms, areas and planner the app shows. Each site row shows the site's red, amber and green task counts and its **on-call** users; on the web the list also starts with the user's **multi-site**. People who work across several sites use it to move between them without signing out. The apps reopen the site last used on the device.

## Rules

### Which sites are listed

* The switcher lists the sites the user belongs to: through a row in the site, or through a membership of one of its groups or asset registers ([GET /v1/app/parents](https://docs.snapfix.com/engineering-reference/api/console.md#get-v1appparents)).
* Churned sites are left out on all three platforms. The web's list comes from the server, which drops them (api\_php\_live\_v2 @ ef3c4319f6, `app/Http/Controllers/v1/Versions/v1_0/App/ParentController.php:91`); iOS leaves them out of its sheet (ios @ aa31967ac8, `SnapFix/ParentSwither/SelectParentVC.swift:255`); Android leaves them out and moves away from a churned current site (android @ 86068bfeea, `app/src/main/java/gmail/com/snapfixapp/bottomSheet/ParentSwitcherBottomSheet.java:161-174`, `:218-230`). The web also keeps a churn banner, and checks task status changes on a churned site (web\_app\_v2 @ 0989b8e685, `src/app/services/task/task-helper/task-helper.service.ts:649-652`).
* The web hides the sites that the sign-in token excludes. When the current site is one of them, the web moves to the first remaining site and opens Fix (web\_app\_v2 @ 0989b8e685, `src/app/services/account/account-helper/account-helper.service.ts:63-96`).
* The web lists the sites by name (`account-helper.service.ts:103-105`).
* On the web, the multi-site comes first, labelled "MULTI-SITE"; choosing it opens the Multi-Site Console's "My Sites" ([My sites](https://docs.snapfix.com/how-the-apps-work/screens/console/my-sites.md)). The apps don't list multi-sites; the Multi-Site Console is web only.

### Choosing a site

* Choosing a site makes it the current site and clears a multi-site choice. The web stays on the page when it can show the site, and otherwise goes to Fix; choosing the current site does nothing. The apps load the site's groups ([Site switcher](https://docs.snapfix.com/how-the-apps-work/screens/groups/site-switcher.md#actions)).
* Every platform keeps the site last chosen and opens it again. With none stored, the web picks the site where the user has the most groups (`account-helper.service.ts:356-362`), and iOS does the same, leaving out churned sites (ios @ aa31967ac8, `SnapFix/BusinessListing+ParentSwither.swift:368-382`).
* A site in another region uses that region's servers. The web stores the region's server addresses when the site is chosen (`account-helper.service.ts:235`); Android needs a connection for such a switch and reloads the site's data (android @ 86068bfeea, `app/src/main/java/gmail/com/snapfixapp/viewModels/BusinessViewModel.java:262-264`).
* The apps load the user's groups in the new site with [read\_parent\_business\_data\_v2](https://docs.snapfix.com/engineering-reference/api/groups.md#post-actionread_parent_business_data_v2), and its checklist templates with [read\_parent\_checklist\_data](https://docs.snapfix.com/engineering-reference/api/checklists.md#post-actionread_parent_checklist_data).
* A user who has no group in any site is signed out by the apps, even when they belong to a site \[[ASK-38](https://github.com/snapfix/docs/blob/main/ASK.md#ask-38-should-a-user-whose-sites-have-no-groups-be-signed-out)].

### What each row shows

* The red, amber and green task counts, on all three platforms. Android shows "--" until they load ([Site switcher](https://docs.snapfix.com/how-the-apps-work/screens/groups/site-switcher.md#layout)).
* New activity: on the web, a badge with the number of tasks that changed in the user's groups there since their last visits ([POST /v1/app/parents/get-updates](https://docs.snapfix.com/engineering-reference/api/console.md#post-v1appparentsget-updates)); on iOS, an unread count. Android shows neither.
* The site's on-call users: the web shows up to six pictures and "+n", and a side panel with the list; the apps open the on-call list. The on-call list returns any site's on-call staff with their contact details.
* A settings button: a gear on sites the user administers and an info icon on the others. On the web it is the "Site Console" button, shown on every site, also to people who can't open the Site Console; they are sent back to Fix.
* iOS also has a chat button that switches to the site and opens its chat. Android's chat button is hidden (android @ 86068bfeea, `app/src/main/res/layout/item_parent_switcher_selection.xml:224-230`).

### On call

* Each user sets their own on-call status per site, one switch per site, on their [Profile](https://docs.snapfix.com/how-the-apps-work/screens/account/profile.md). What being on call changes beyond these lists is open \[[ASK-36](https://github.com/snapfix/docs/blob/main/ASK.md#ask-36-what-does-being-on-call-change)].
* The Laravel on-call change can create a site membership, also for a site that blocked the user ([PUT /v1/app/user/on-call-status](https://docs.snapfix.com/engineering-reference/api/account.md#put-v1appuseron-call-status)).

### New sites

* When the server reports sites the user was just given, the web shows "Congratulations {first name}!" once per session, with "You now have access to" and the site, and "Go to Site" ([Site switcher](https://docs.snapfix.com/how-the-apps-work/screens/groups/site-switcher.md#dialogs-and-sheets)).

## Flow

```mermaid
flowchart LR
  open["Site name: side menu (web) or top bar (apps)"] --> load["Sites, counts, new activity and on-call users"]
  load --> pick{"Pick"}
  pick -->|"a site"| set["Current site"]
  set --> region{"Another region?"}
  region -->|"yes"| servers["Use that region's servers and reload"]
  region -->|"no"| show["Groups, tasks and planner of the site"]
  servers --> show
  pick -->|"MULTI-SITE (web)"| multi["Multi-Site Console: My Sites"]
  pick -->|"Site Console or settings"| console["Site settings, or Fix for non-admins on the web"]
  pick -->|"On call"| oncall["On-call users"]
```

## Platforms

| Capability                  | Web                           | iOS                                      | Android                                          |
| --------------------------- | ----------------------------- | ---------------------------------------- | ------------------------------------------------ |
| Where it opens              | Side menu, from the site name | Sheet, from the site name in the top bar | Bottom sheet, from the site name in the top bar  |
| Search                      | No                            | Yes                                      | Yes                                              |
| Multi-site row              | First, "MULTI-SITE"           | No                                       | No                                               |
| Red, amber and green counts | Yes                           | Yes                                      | Yes                                              |
| New activity                | Badge                         | Unread count                             | No                                               |
| On-call users               | Pictures and a side panel     | Pictures; tap for the list               | Pictures; tap for the list                       |
| Settings button             | "Site Console" on every site  | Gear or info icon                        | Gear or info icon                                |
| Chat button                 | No                            | Yes                                      | Hidden                                           |
| Churned sites               | Left out                      | Left out                                 | Left out; moves away from a churned current site |
| Opens the last site         | Yes                           | Yes                                      | Yes                                              |

## Screens

* [Site switcher](https://docs.snapfix.com/how-the-apps-work/screens/groups/site-switcher.md): the list, its rows, choosing a site, on-call users and the "Congratulations" dialog.
* [Profile](https://docs.snapfix.com/how-the-apps-work/screens/account/profile.md): the on-call switch for each site.
* [My sites](https://docs.snapfix.com/how-the-apps-work/screens/console/my-sites.md): what the multi-site row opens.
* [Site details](https://docs.snapfix.com/how-the-apps-work/screens/console/site-details.md): what the "Site Console" button opens for admins.
* [Groups](https://docs.snapfix.com/how-the-apps-work/screens/groups/group-list.md): the groups of the current site, and the apps' on-call banner.

## API and data

* [Console API](https://docs.snapfix.com/engineering-reference/api/console.md): the web's site list with counts and multi-sites ([GET /v1/app/parents](https://docs.snapfix.com/engineering-reference/api/console.md#get-v1appparents)), its new-activity badges ([POST /v1/app/parents/get-updates](https://docs.snapfix.com/engineering-reference/api/console.md#post-v1appparentsget-updates)), and the apps' counts ([webcust\_list\_parents\_v2](https://docs.snapfix.com/engineering-reference/api/console.md#post-actionwebcust_list_parents_v2)).
* [Tasks API](https://docs.snapfix.com/engineering-reference/api/tasks.md): the iOS unread counts ([read\_parent\_jobs\_new\_updates](https://docs.snapfix.com/engineering-reference/api/tasks.md#post-actionread_parent_jobs_new_updates)).
* [Users API](https://docs.snapfix.com/engineering-reference/api/users.md): the on-call list, `POST /v1/app/user/on-call`.
* [Account API](https://docs.snapfix.com/engineering-reference/api/account.md): a user's own on-call status, [GET](https://docs.snapfix.com/engineering-reference/api/account.md#get-v1appuseron-call-status) and [PUT /v1/app/user/on-call-status](https://docs.snapfix.com/engineering-reference/api/account.md#put-v1appuseron-call-status).
* [Groups API](https://docs.snapfix.com/engineering-reference/api/groups.md): the apps' group load at a switch ([read\_parent\_business\_data\_v2](https://docs.snapfix.com/engineering-reference/api/groups.md#post-actionread_parent_business_data_v2)).
* Tables: [`tPri_Parent`](https://docs.snapfix.com/engineering-reference/db/tables/tpri_parent.md) (the site, with its customer type), [`tPri_UserParent`](https://docs.snapfix.com/engineering-reference/db/tables/tpri_userparent.md) (a user's site row, with the on-call flag), [`tPri_SettingsParent`](https://docs.snapfix.com/engineering-reference/db/tables/tpri_settingsparent.md) (site settings), [`tPri_MultiSite`](https://docs.snapfix.com/engineering-reference/db/tables/tpri_multisite.md), [`tPri_MultiSiteUser`](https://docs.snapfix.com/engineering-reference/db/tables/tpri_multisiteuser.md) and [`tPri_MultiSiteParent`](https://docs.snapfix.com/engineering-reference/db/tables/tpri_multisiteparent.md) (multi-sites).

## Depends on

* [Groups](https://docs.snapfix.com/product/features/groups/groups.md) and [Group members](https://docs.snapfix.com/product/features/groups/group-members.md): the groups a user has in each site, which load after a switch.
* [Planned tasks](https://docs.snapfix.com/product/features/planner/planned-tasks.md): the planner loads for the current site.
* [Multi-Site Console](https://docs.snapfix.com/product/features/console/multi-site-console.md): what the multi-site row opens.
* [Site details](https://docs.snapfix.com/product/features/console/site-details.md) and [Site users](https://docs.snapfix.com/product/features/console/site-users.md): the Site Console behind the settings button.
* [Profile and settings](https://docs.snapfix.com/product/features/account/profile.md): each user's on-call switch.
* [Sign-in](https://docs.snapfix.com/product/features/account/sign-in.md) and [App launch](https://docs.snapfix.com/product/features/account/app-launch.md): the site list loaded after sign-in, and the site the apps reopen.
* [Joining a site](https://docs.snapfix.com/product/features/onboarding/join-site.md) and [Email and SMS links](https://docs.snapfix.com/product/features/account/email-links.md): new sites, and the "Congratulations" dialog.
* [Chat](https://docs.snapfix.com/product/features/chat/chat.md): the iOS chat button; the web hides Chat while a multi-site is selected.

## Edge cases

* **Offline (apps):** the sites come from the device; counts and on-call users load when the device is online. A switch to a site in another region needs a connection on Android.
* **Missing permission:** none for the list. The web's "Site Console" button shows to everyone.
* **No sites (web):** the menu shows "No data available". When the site list comes back empty or fails, the web says "Your login was successful but it appears that you are not assigned to any Site or Group." with "Reload" and "Log out" ([Site switcher](https://docs.snapfix.com/how-the-apps-work/screens/groups/site-switcher.md#states)).
* **No groups (apps):** the user is signed out \[[ASK-38](https://github.com/snapfix/docs/blob/main/ASK.md#ask-38-should-a-user-whose-sites-have-no-groups-be-signed-out)].
* **Churned or excluded sites:** left out; the web and Android move away from a current site that drops out of the list.
* **Blocked site:** the Laravel on-call change can give the user a membership row again.
* **Several regions:** a switch changes the servers the app uses.
* **Time zones and integrations:** none for site switching.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.snapfix.com/product/features/groups/site-switching.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
