Mantieni tutto organizzato con le raccolte
Salva e classifica i contenuti in base alle tue preferenze.
Campi utente validi per le query del gruppo dinamico
Questa pagina illustra i campi e le funzionalità di CEL supportati che possono essere utilizzati in una query di appartenenza.
Campi utente
I seguenti campi della risorsa
User
dell'SDK Amministrazione possono essere utilizzati nelle query di appartenenza.
Campo
Campo secondario
addresses
country
country_code
custom_type
extended_address
locality
po_box
postal_code
primary
region
street_address
type
archived
boolean
change_password_at_next_login
boolean
is_2sv_enforced
boolean
is_enrolled_in_2sv
boolean
is_mailbox_setup
boolean
locations
area
building_id
custom_type
desk_code
floor_name
floor_section
type
organizations
cost_center
custom_type
department
description
domain
location
name
primary
symbol
title
type
relations
custom_type
type
value
emails
address
custom_type
primary
type
external_ids
custom_type
type
value
gender
address_me_as
custom_gender
type
ims
custom_protocol
custom_type
standard_protocol
primary
type
value
keywords
custom_type
type
value
languages
language_code
name
family_name
given_name
value
phones
custom_type
primary
type
value
suspended
boolean
suspension_reason
custom_type
type
value
websites
custom_type
primary
type
value
Attributi di tipo
Gli attributi type della tabella precedente vengono abbinati utilizzando i valori dell'enum anziché le relative rappresentazioni di stringa. L'elenco seguente mostra la rappresentazione in stringa di ogni tipo e il valore dell'enum corrispondente.
Attributo
Valore enum
Rappresentazione di stringhe
Indirizzi
0
sconosciuto
1
personalizzata
2
home
3
lavoro
4
altro
Località
0
predefinita
1
personalizzata
2
scrivania
Organizzazioni
0
sconosciuto
1
lavoro
2
scuola
3
solo per il dominio
Relazioni
12
manager
Email
0
sconosciuto
1
personalizzata
2
home
3
lavoro
4
altro
ID esterni
0
sconosciuto
1
personalizzata
2
account
3
cliente
4
e viceversa
5
organizzazione
6
login_id
Genere
0
sconosciuto
1
maschio
2
femmina
3
altro
Protocollo standard IMS
0
predefinita
1
protocollo personalizzato
2
scopo
3
msn
4
yahoo
5
skype
6
qq
7
gtalk
8
icq
9
Jabber
10
riunione di rete
Tipo di messaggistica immediata
0
sconosciuto
1
personalizzata
2
home
3
lavoro
4
altro
Parole chiave
0
sconosciuto
1
personalizzata
2
missione
3
professione
4
Outlook
Smartphone
0
sconosciuto
1
personalizzata
2
home
3
lavoro
4
altro
5
fax casa
6
fax lavoro
7
mobile
8
cercapersone
9
altro fax
10
azienda (principale)
11
assistente
12
auto
13
radio
14
isdn
15
callback
16
telex
17
tty tdd
18
Cellulare lavoro
19
cercapersone lavoro
20
main
21
Grand Central
22
Enterprise Voice
Motivo della sospensione
1
amministratore
2
minori di 13 anni
3
Accesso web obbligatorio
4
abuso
5
abuse—recoverable by admin
Siti web
0
sconosciuto
1
Pagina di installazione dell'app
2
blog
3
personalizzata
4
ftp
5
home
6
home page
7
altro
8
profilo
9
reservations
10
riprendi
11
lavoro
Campi dell'unità organizzativa
Puoi anche eseguire query sulle iscrizioni utilizzando il campo orgUnitId per includere tutti gli utenti che fanno parte dell'unità organizzativa, direttamente o indirettamente. Per ulteriori informazioni sul recupero del valore orgUnitId, consulta la documentazione di riferimento dell'SDK Admin.
Query di esempio
Tutti gli utenti diretti di una determinata unità organizzativa:
user.org_unit_id==orgUnitId('03ph8a2z1enx4lx')
Tutti gli utenti diretti e indiretti di una determinata unità organizzativa:
Sostituisci MANAGER_ID con l'ID utente univoco del gestore. Puoi recuperare questo ID con l'API Directory dell'SDK Admin utilizzando l'indirizzo email del gestore come userKey.
[[["Facile da capire","easyToUnderstand","thumb-up"],["Il problema è stato risolto","solvedMyProblem","thumb-up"],["Altra","otherUp","thumb-up"]],[["Difficile da capire","hardToUnderstand","thumb-down"],["Informazioni o codice di esempio errati","incorrectInformationOrSampleCode","thumb-down"],["Mancano le informazioni o gli esempi di cui ho bisogno","missingTheInformationSamplesINeed","thumb-down"],["Problema di traduzione","translationIssue","thumb-down"],["Altra","otherDown","thumb-down"]],["Ultimo aggiornamento 2025-09-04 UTC."],[[["\u003cp\u003eThis document lists the supported user fields from the Admin SDK's \u003ccode\u003eUser\u003c/code\u003e resource that can be used in dynamic group membership queries, which are available to certain Google Workspace and Cloud Identity accounts.\u003c/p\u003e\n"],["\u003cp\u003eCustom user fields are supported in queries, provided that the schema already exists within \u003ccode\u003euser.custom_schemas\u003c/code\u003e, as detailed in the linked documentation.\u003c/p\u003e\n"],["\u003cp\u003eThe document specifies which fields can be used and the sub-fields each one has, with the inclusion of \u003ccode\u003eboolean\u003c/code\u003e types and when a field has a \u003ccode\u003eprimary\u003c/code\u003e value that can only be evaluated as true.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003etype\u003c/code\u003e attributes used in the user fields table are matched to enum values rather than string representations, and a table is provided mapping the string values to their corresponding enum values.\u003c/p\u003e\n"],["\u003cp\u003eMembership queries can also be performed using the \u003ccode\u003eorgUnitId\u003c/code\u003e field to include users directly or indirectly within a specified organizational unit, and the document also includes sample queries on how to retrieve users by their org unit, or managers.\u003c/p\u003e\n"]]],[],null,["# Valid user fields for dynamic group queries\n===========================================\n\nThis page outlines supported fields and features of CEL that can be\nused in a membership query.\n| **Note:** Dynamic groups are only available to Google Workspace Enterprise Standard, Enterprise Plus, Enterprise for Education, and Cloud Identity premium accounts.\n\nUser fields\n-----------\n\nThe following fields from the Admin SDK's\n[`User`](https://developers.google.com/admin-sdk/directory/reference/rest/v1/users)\nresource can be used in membership queries.\n| **Note:** Custom user fields are also supported as long as the schema already exists in `user.custom_schemas`. See [Manage custom user fields](https://developers.google.com/admin-sdk/directory/v1/guides/manage-schemas) for more information about creating a custom schema.\n\n| **Note:** When a field has a `primary` value, that value can only be evaluated as a true expression. For example: \n| `user.addresses.exists(addr, addr.primary == true)\"`\n\n### Type attributes\n\nThe `type` attributes from the previous table are matched using enum values\ninstead of their string representations. The following list documents each\ntype's string representation to the corresponding enum value.\n\nOrganizational unit fields\n--------------------------\n\nYou can also query memberships using the `orgUnitId` field to include all\nusers who are part of that organizational unit, directly or indirectly. For more\ninformation about retrieving the `orgUnitId` value, see the\n[Admin SDK reference documentation](https://developers.google.com/admin-sdk/directory/reference/rest/v1/orgunits).\n\n### Sample queries\n\n- All direct users under a given organizational unit:\n\n user.org_unit_id==orgUnitId('03ph8a2z1enx4lx')\n\n- All direct and indirect users under a given organizational unit:\n\n user.org_units.exists(org_unit, org_unit.org_unit_id==orgUnitId('03ph8a2z1khexns'))\n\nOther query types\n-----------------\n\n- All users managed by a specific individual:\n\n user.managers.exists(manager, manager.user_id == userId('\u003cvar translate=\"no\"\u003eMANAGER_ID\u003c/var\u003e'))\n\n Replace \u003cvar translate=\"no\"\u003eMANAGER_ID\u003c/var\u003e with the manager's unique\n user ID. You can retrieve this ID with the\n [AdminSDK Directory API](https://developers.google.com/admin-sdk/directory/reference/rest/v1/users/get)\n using the manager's email address as `userKey`."]]