> ## Documentation Index
> Fetch the complete documentation index at: https://university.triggr-app.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Clients and variables

> Add the businesses you support, store each one's IDs and settings as variables, and set your organisation's defaults.

Each client carries variables, such as its Microsoft tenant ID or PSA client ID, that forms and workflows use to act for the right business.

<Frame caption="Clients and variables: adding a client, giving it variables and finding your org variables (1:20).">
  <video controls preload="none" playsInline className="w-full aspect-video rounded-xl" poster="/images/videos/studio-clients.jpg" src="https://mintcdn.com/triggr/GxrCQFDFNLmEMyJ1/images/videos/studio-clients.mp4?fit=max&auto=format&n=GxrCQFDFNLmEMyJ1&q=85&s=e4555b985bc8bee55fd165af10b31e7d" data-path="images/videos/studio-clients.mp4" />
</Frame>

<Frame>
  <img src="https://mintcdn.com/triggr/_d7ojda9vf8IHE31/images/studio/clients/clients-list.png?fit=max&auto=format&n=_d7ojda9vf8IHE31&q=85&s=4518f444e112470dc81e12659d6c9ab0" alt="The Clients page with Refresh, Standard Variables and New Client buttons, the Standard Variables menu open on Set Client Variables and Define Standard Variables, and a table listing Acme Corp, Initech and Globex, each Cloud Only with No agents." width="2305" height="910" data-path="images/studio/clients/clients-list.png" />
</Frame>

## Add a client

<Steps>
  <Step title="Create it">
    In Clients, click **New Client**, enter the name, choose the Environment and click **Create Client**.

    <Frame>
      <img src="https://mintcdn.com/triggr/_d7ojda9vf8IHE31/images/studio/clients/new-client.png?fit=max&auto=format&n=_d7ojda9vf8IHE31&q=85&s=d94acd3930547a2afb513ea36f76ceb6" width="512" alt="The Create New Client dialog with the name Acme Corp, Environment set to Cloud Only, and Cancel and Create Client buttons." data-path="images/studio/clients/new-client.png" />
    </Frame>
  </Step>

  <Step title="Open it">
    Click **View** on its row. Edit changes the name or environment; Agent Credentials sets up the [desktop agent](/desktop-agent/generate-credentials).

    <Frame>
      <img src="https://mintcdn.com/triggr/_d7ojda9vf8IHE31/images/studio/clients/client-page.png?fit=max&auto=format&n=_d7ojda9vf8IHE31&q=85&s=9a187c534c57d8ebb6df9a1ca2ef8aa8" alt="The Acme Corp client page with Edit, Agent Credentials and Refresh buttons, a Client Details card showing the name, ID, Cloud Only environment and created date, and a Variables card with Manage Variables listing primaryContactEmail, connectwiseId, googleWorkspaceDomain and microsoftTenantId." width="2320" height="1498" data-path="images/studio/clients/client-page.png" />
    </Frame>
  </Step>
</Steps>

Choose **Cloud Only** for Microsoft 365-only clients; the other environments are for clients with on-premises Active Directory. Clients are shared with [Triggr Core](/core/get-started/add-your-clients), so clients added or imported there appear here too.

## Give it variables

<Steps>
  <Step title="Open its variables">
    Click **Manage Variables** on the client's Variables card.
  </Step>

  <Step title="Add a variable">
    Click **New Variable**, enter the Key and Value, and click **Create Variable**.

    <Frame>
      <img src="https://mintcdn.com/triggr/_d7ojda9vf8IHE31/images/studio/clients/new-client-variable.png?fit=max&auto=format&n=_d7ojda9vf8IHE31&q=85&s=77ee44d88703ab47287ba8c1d96b3842" width="512" alt="The New Variable dialog with Key microsoftTenantId and Value 11111111-2222-3333-4444-555555555555, and Cancel and Create Variable buttons." data-path="images/studio/clients/new-client-variable.png" />
    </Frame>
  </Step>

  <Step title="Fill in anything Not Set">
    Click **Set Value** on any [standard variable](#standard-variables) marked Not Set.

    <Frame>
      <img src="https://mintcdn.com/triggr/_d7ojda9vf8IHE31/images/studio/clients/client-variables.png?fit=max&auto=format&n=_d7ojda9vf8IHE31&q=85&s=8e75e4b3e19de6a68edb3958e79833b8" alt="The Acme Corp - Variables page with the Unset Variables switch on, four set variables with Edit and Delete buttons, and Default usage location (defaultUsageLocation) marked Not Set with its description and a Set Value button." width="2880" height="720" data-path="images/studio/clients/client-variables.png" />
    </Frame>
  </Step>
</Steps>

Keys are case-sensitive: `microsoftTenantId` works, `MicrosoftTenantID` doesn't. A value that's a number, `true`, `false` or JSON reaches workflows as that type; anything else is text.

Integration IDs come from mapping instead: map clients on an integration's Client Mapping card, or click Map or Edit Mapping on the client's Integrations card, and Triggr saves each match as a variable.

<Frame>
  <img src="https://mintcdn.com/triggr/_d7ojda9vf8IHE31/images/studio/clients/client-integrations.png?fit=max&auto=format&n=_d7ojda9vf8IHE31&q=85&s=d765914a385db128952aa4eca4f3bcae" alt="The client's Integrations card listing ConnectWise Manage as Ready, Base config and Mapped with Edit Mapping, and Microsoft Exchange and Microsoft Graph (SAM) as Ready, Base config, mapping N/A, each with Configure." width="2240" height="692" data-path="images/studio/clients/client-integrations.png" />
</Frame>

## Variables Triggr uses

| Variable | Set by | Used by |
| - | - | - |
| `microsoftTenantId` | [Microsoft Graph (GDAP)](/integrations/microsoft-graph/gdap-service-account) linking, Per-Client Configuration for [Microsoft Graph (SAM)](/integrations/microsoft-graph/sam) or [Defender for Endpoint](/integrations/microsoft-defender-endpoint), Triggr Core, or by hand | [Microsoft sign-in](/studio/forms/authentication) on forms and apps, Set Client From Form, [CIPP](/integrations/cipp) steps |
| `microsoftTenantDomain` | GDAP linking, or [Microsoft Exchange](/integrations/microsoft-exchange)'s Per-Client Configuration | Microsoft Exchange steps |
| `googleWorkspaceDomain` | By hand; separate several domains with commas | [Google sign-in](/studio/forms/authentication) on forms and apps |
| `haloId`, `connectwiseId`, `autotaskId` | Client Mapping for [HaloPSA](/integrations/halopsa), [ConnectWise PSA](/integrations/connectwise-psa) or [Autotask](/integrations/autotask) | Create Ticket when its client ID is blank |
| `pax8Id`, `sherwebId`, `tdSynnexId` | Client Mapping for [Pax8](/integrations/pax8), [Sherweb](/integrations/sherweb) or [TD SYNNEX Stellr](/integrations/td-synnex/stellr), or linking in Core | Core's [automatic seat purchase](/core/manage/licences-and-distributors#buy-seats-automatically) |

Other Client Mapping cards save an ID for your workflows to pass into that integration's actions: `autoElevateCompanyId`, `auvikTenantId`, `dattoBcdrOrganizationId`, `dattoSaasProtectionId`, `dattoSiteId` and `dattoSiteUid`, `duoAccountId`, `fieldEffectOrganizationId`, `hubspotId`, `huduId`, `huntressId`, `itGlueId`, `ncentralCustomerId`, `ninjaId`, `organizationId` (DNSFilter), `sentinelOneSiteId` and `syncroId`. Each integration's guide says which actions take it.

## Use variables in a workflow

Once a [Client step](/studio/workflows/steps#client) such as Set Client From Form has run, `ctx.client` holds the client's `id`, `name`, `environment` and every variable; org variables are in `ctx.org`:

```text theme={null}
{{ ctx.client.name }}                 Acme Corp
{{ ctx.client.microsoftTenantId }}    11111111-2222-3333-4444-555555555555
{{ ctx.client.primaryContactEmail }}  jane.doe@acme.com
{{ ctx.org.defaultPSA }}              halo
```

`environment` is `cloudOnly`, `onPremOnly`, `cloudAndOnPremSeparate` or `cloudAndOnPremSynced`. A client mapped to several external clients has the first ID in `haloId`, all of them in `haloIdList` and a comma-separated list in `haloIdCsv`; the same goes for every mapping. See [Expressions](/studio/workflows/expressions) for everything else a template can read.

To save a value back, add the Triggr group's **Set Client Variable** step with **Client ID** `{{ ctx.client.id }}`. An empty Value deletes the variable.

<Frame>
  <img src="https://mintcdn.com/triggr/_d7ojda9vf8IHE31/images/studio/clients/set-client-variable-step.png?fit=max&auto=format&n=_d7ojda9vf8IHE31&q=85&s=2de9104d5ebbc77e8037017339021440" width="384" alt="The Triggr Set Client Variable step panel with Client ID ctx.client.id, Property lastNewStarterDate and Value ctx.params.startDate, each as a template." data-path="images/studio/clients/set-client-variable-step.png" />
</Frame>

To find a client from an ID another system sends, use **Search For Client** with Property Variable (see [Steps](/studio/workflows/steps#client)).

## Standard variables

Standard variables are the checklist of variables every client should have. They don't hold values: a client without one shows Not Set, and a template that reads it fails with “Missing or invalid variable”.

<Steps>
  <Step title="Define them">
    In Clients, click **Standard Variables > Define Standard Variables**, then **New Variable**. Enter the Key, Label and Description, and click **Create Variable**.

    <Frame>
      <img src="https://mintcdn.com/triggr/_d7ojda9vf8IHE31/images/studio/clients/new-standard-variable.png?fit=max&auto=format&n=_d7ojda9vf8IHE31&q=85&s=0ee142e45eec21e77f67ad84cf6c8b4f" width="512" alt="The New Standard Client Variable dialog with Key defaultUsageLocation, Label Default usage location, and Description Two-letter country code for new Microsoft 365 users, such as GB." data-path="images/studio/clients/new-standard-variable.png" />
    </Frame>

    <Frame>
      <img src="https://mintcdn.com/triggr/_d7ojda9vf8IHE31/images/studio/clients/standard-variables.png?fit=max&auto=format&n=_d7ojda9vf8IHE31&q=85&s=5bd23dc24e1e7503275f841526f8c222" alt="The Standard Client Variables page listing defaultUsageLocation and primaryContactEmail with their labels, descriptions, created dates, and Edit and Delete buttons." width="2880" height="400" data-path="images/studio/clients/standard-variables.png" />
    </Frame>
  </Step>

  <Step title="Fill them in for every client">
    Click **Standard Variables > Set Client Variables**. Type in a cell and press Enter to save; Esc cancels.

    <Frame>
      <img src="https://mintcdn.com/triggr/_d7ojda9vf8IHE31/images/studio/clients/set-variables-all-clients.png?fit=max&auto=format&n=_d7ojda9vf8IHE31&q=85&s=b57f08071fab4c4f161198aef9afdb21" alt="The Set Variables for All Clients grid with a row for each of Acme Corp, Globex and Initech and a column for Default usage location and Primary contact email; Globex has US and it@globex.com, Acme Corp has only jane.doe@acme.com." width="2880" height="500" data-path="images/studio/clients/set-variables-all-clients.png" />
    </Frame>
  </Step>
</Steps>

## Org variables

Org variables apply to your whole organisation. Find them in **Settings > Org Variables**; workflows read them as `ctx.org.<key>`, and form fields can show or hide on them.

<Frame>
  <img src="https://mintcdn.com/triggr/_d7ojda9vf8IHE31/images/studio/clients/org-variables.png?fit=max&auto=format&n=_d7ojda9vf8IHE31&q=85&s=97bc3eff011b1673b0fab2555c571327" alt="The Organization Variables page with Setup Wizard, Refresh and New Variable buttons, listing defaultMicrosoftConnection set to microsoftGDAP, defaultPSA set to halo and helpdeskEmail set to helpdesk@yourmsp.com, each with Edit and Delete." width="2880" height="505" data-path="images/studio/clients/org-variables.png" />
</Frame>

Setup Wizard sets the two that steps rely on. Each choice saves as soon as you click it.

<Steps>
  <Step title="Preferred Microsoft Connection Method">
    <Frame>
      <img src="https://mintcdn.com/triggr/_d7ojda9vf8IHE31/images/studio/clients/setup-wizard-microsoft.png?fit=max&auto=format&n=_d7ojda9vf8IHE31&q=85&s=8b2f926889deab33223e64bdd43e46eb" alt="The Setup Wizard's Preferred Microsoft Connection Method question with three cards: CIPP, GDAP and Individual Enterprise Apps, the last one selected." width="2272" height="580" data-path="images/studio/clients/setup-wizard-microsoft.png" />
    </Frame>
  </Step>

  <Step title="Preferred PSA">
    Pick your PSA and click **Finish**.

    <Frame>
      <img src="https://mintcdn.com/triggr/_d7ojda9vf8IHE31/images/studio/clients/setup-wizard-psa.png?fit=max&auto=format&n=_d7ojda9vf8IHE31&q=85&s=6103f45917d3fc6f0e9720f875f2aad3" alt="The Setup Wizard's Preferred PSA question with cards for Halo PSA, ConnectWise PSA, Syncro PSA, Autotask by Datto and Other." width="2272" height="800" data-path="images/studio/clients/setup-wizard-psa.png" />
    </Frame>
  </Step>
</Steps>

| Choice | Saves | What it does |
| - | - | - |
| CIPP, GDAP or Individual Enterprise Apps | `defaultMicrosoftConnection`: `CIPP`, `microsoftGDAP` or `microsoftSAM` | Microsoft steps with Connection Type Automatic, and Microsoft dropdowns on forms, connect through [CIPP](/integrations/cipp), [Microsoft Graph (GDAP)](/integrations/microsoft-graph/gdap-service-account) or [Microsoft Graph (SAM)](/integrations/microsoft-graph/sam) |
| A PSA | `defaultPSA`: `halo`, `connectwise`, `autotask`, `syncro` or `other` | Create Ticket and Log to Ticket raise and update tickets in it (Halo PSA, ConnectWise PSA and Autotask by Datto) |

Triggr Core's PSA and Microsoft settings save the same two variables, so changing them in either app changes both.

## FAQ

<AccordionGroup>
  <Accordion title="“Failed to save variable” when I add a variable">
    The client may already have a variable with that key. Click Edit on its row instead.
  </Accordion>

  <Accordion title="“org.defaultPSA not found or empty” or “unsupported PSA system: …”">
    Create Ticket needs `defaultPSA` set to `halo`, `connectwise` or `autotask`. Run Setup Wizard and pick your PSA.
  </Accordion>

  <Accordion title="“org.defaultMicrosoftConnection not found or empty”">
    Run Setup Wizard and choose a Microsoft connection method, or set the step's Connection Type.
  </Accordion>

  <Accordion title="“microsoftTenantId not found in tenant metadata. CIPP requires a tenant filter.”">
    The run's client has no `microsoftTenantId`. Add it on Manage Variables.
  </Accordion>

  <Accordion title="I changed a variable but the run used the old value">
    `ctx.client` is read when the run sets its client, so changes apply from the next run, including values written by Set Client Variable earlier in the same run.
  </Accordion>

  <Accordion title="I can't see New Client or Standard Variables">
    They need the Admin role. See [Team and permissions](/studio/clients/team-and-permissions).
  </Accordion>
</AccordionGroup>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.