> For the complete documentation index, see [llms.txt](https://docs.hoozin.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.hoozin.com/dir-sync/user-profile-schema.md).

# User Profile Schema

## Features

User profile schemas can be customized by adding, removing, or reorganizing fields that make up the user profile page.

You can add new fields or hide existing fields. For each field, you can set the name or the order. You can allocate fields in specific sections.

You can add new sections or hide existing sections; these blocks are called **Groups**. For each group, you can choose a name and set its position on the profile page.

You can decide who can edit a field. For each group, if no group fields can be edited, the **Edit** button will not be displayed.

You can define and customize the profile strength by assigning weight to each field. The sum of the weights should be `100`.

## Database schema

### `USER_PROFILE_FIELD_GROUPS` table

This table lists the field groups. You can group fields by different sections. By default, there are five groups that can be renamed, hidden, or ordered. If you want to add a new custom group, add a new row to this table.

| Column         | Type            | Description                                                                                                                                                                                                                       |
| -------------- | --------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `FieldGroup`   | `nvarchar(50)`  | Field group name used as a unique identifier                                                                                                                                                                                      |
| `DefaultLabel` | `nvarchar(255)` | <p>Group display name<br></p><p>Displayed if no corresponding label found in table <code>USER\_PROFILE\_FIELD\_GROUP\_LABELS</code>. You can use a resource with the syntax <code>{Resource:resourceFile,resourceKey}</code> </p> |
| `IsVisible`    | `boolean`       | `False` to hide the group or `True` to show the group                                                                                                                                                                             |
| `IsCustom`     | `boolean`       | <p><strong>For internal use only</strong><br>Used by the database manager to define this entry as a built-in hoozin group</p>                                                                                                     |
| `DisplayOrder` | `integer`       | Sets the display order if you want to reorganize groups                                                                                                                                                                           |

### `USER_PROFILE_FIELD_GROUP_LABELS` table

If no resource file is defined for a group name, use the items in this table to set its label.&#x20;

Define the group name in each language. If the group name is not defined in a specific language, the default label of the`USER_PROFILE_FIELD_GROUPS` table will be used.

| Column       | Type           | Description                                                                                                     |
| ------------ | -------------- | --------------------------------------------------------------------------------------------------------------- |
| `ID`         | `guid`         | <p>Unique identifier<br><br>Generate a new GUID to add a new label.</p>                                         |
| `FieldGroup` | `nvarchar(50)` | Define the field section, which should correspond to a valid `USER_PROFILE_FIELD_GROUPS.FieldGroup` record      |
| `LanguageID` | `integer`      | <p>Lang LCID</p><p><strong>Example:</strong> <code>1033</code> for English and <code>1036</code> for French</p> |
| `Text`       | `nvarchar(50)` | Group display name                                                                                              |

### `USER_PROFILE_FIELDS` table

Use the items in this table to define the fields available in the user profile screen. Default fields can be renamed and reordered. If you want to add a new custom field, add a new row to this table.

| Column         | Type            | Description                                                                                                                                                                                                                                                                                                                                      |
| -------------- | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `FieldName`    | `nvarchar(50)`  | <p>Field unique ID</p><p></p><p>Your custom fields should be named from <code>hoozinExtAttr001</code>to <code>hoozinExtAttr010</code>. Multiline fields or tags should be named from <code>hoozinExtAttrMulti001</code> to <code>hoozinExtAttrMulti010</code>.</p>                                                                               |
| `DataType`     | `nvarchar(50)`  | <p>Field data type:</p><ul><li><code>Text</code> for standard text</li><li><code>MultiLine</code> for text areas</li><li><code>Tags</code> for a list of tags</li></ul>                                                                                                                                                                          |
| `DefaultLabel` | `nvarchar(255)` | <p>Field display name</p><p></p><p>Displayed if no corresponding label is found in the<code>USER\_PROFILE\_FIELD\_LABELS</code> table. You can use a resource with the syntax <code>{Resource:resourceFile,resourceKey}</code> .</p>                                                                                                             |
| `IsSearchable` | `boolean`       | `True` if you want to promote this field as a search criteria in users' advanced search pages                                                                                                                                                                                                                                                    |
| `IsVisible`    | `boolean`       | `False` to hide the field  or `True` to show the field                                                                                                                                                                                                                                                                                           |
| `IsCustom`     | `Boolean`       | <p><strong>For internal use only</strong><br>Always use <code>False</code>.</p>                                                                                                                                                                                                                                                                  |
| `DisplayOrder` | `integer`       | Sets the display order if you want to reorganize fields                                                                                                                                                                                                                                                                                          |
| `Weight`       | `integer`       | <p>Field weight to customize the value of each field for the profile strength</p><p></p><p>You should have <code>100</code> as the result when performing  the <code>SELECT SUM(Weight) FROM USER\_PROFILE\_FIELDS</code> SQL query.</p>                                                                                                         |
| `FieldGroup`   | `nvarchar(50)`  | <p>Define the field section</p><p></p><p>This should correspond to a valid <code>USER\_PROFILE\_FIELD\_GROUPS.FieldGroup</code> record.</p>                                                                                                                                                                                                      |
| `Editable`     | `nvarchar(50)`  | <p>Field editing policy<br></p><p>If the field can be set by all types of users, insert <code>any</code>. Use <code>internal</code> for internal users only and <code>external</code> for external users only.</p>                                                                                                                               |
| `IsReported`   | `boolean`       | <p><strong>For internal use only</strong></p><p>Always use <code>False</code> .</p>                                                                                                                                                                                                                                                              |
| `XmlNodeName`  | `nvarchar(50)`  | <p>Label defined in the hoozin back office to link user directory and hoozin<br></p><p>This is generally the directory entry label. To add new fields, use range <code>hoozinExtAttr001</code> to <code>hoozinExtAttr010</code> , or  <code>hoozinExtAttrMulti001</code> to <code>hoozinExtAttrMulti010</code> for multiline fields or tags.</p> |
| `IsMandatory`  | `boolean`       | `True` to force users to fill this field                                                                                                                                                                                                                                                                                                         |
| `Watermark`    | `nvarchar(255)` | <p>Field placeholder<br></p><p>You can use a resource with the syntax <code>{Resource:resourceFile,resourceKey}</code></p>                                                                                                                                                                                                                       |

### `USER_PROFILE_FIELD_LABELS` table

If no resource file is defined for a field name, use the items in this table.

Define the field name in each language. If the field name is not defined in a specific language, the default label of the`USER_PROFILE_FIELDS` table will be used.

| Column       | Type           | Description                                                                                                                   |
| ------------ | -------------- | ----------------------------------------------------------------------------------------------------------------------------- |
| `ID`         | `guid`         | <p>Unique identifier<br></p><p>Generate a new GUID to add a new label.</p>                                                    |
| `FieldName`  | `nvarchar(50)` | <p>Define the field name<br></p><p>This should correspond to a valid <code>USER\_PROFILE\_FIELDS.FieldName</code> record.</p> |
| `LanguageID` | `integer`      | <p>Lang LCID</p><p><strong>Example:</strong> <code>1033</code> for English and <code>1036</code> for French</p>               |
| `Text`       | `nvarchar(50)` | Field display name                                                                                                            |

## Default field definitions

| Name                           | Type        | Description                   | XmlNodeName         |
| ------------------------------ | ----------- | ----------------------------- | ------------------- |
| `department`                   | `Text`      | Company department or service | `Department`        |
| `facsimileTelephoneNumber`     | `Text`      | Fax number                    | `Fax`               |
| `givenName`                    | `Text`      | First name                    | `FirstName`         |
| `homePhone`                    | `Text`      | Home phone number             | `HomePhone`         |
| `hoozinCountry`                | `Text`      | Company country               | `Country`           |
| `hoozinSkills`                 | `Tags`      | Skills                        | `Skills`            |
| `hoozinSocialLinkFacebookID`   | `Text`      | Facebook account link         | `FacebookAccount`   |
| `hoozinSocialLinkGooglePlusID` | `Text`      | Google+ account link          | `GooglePlusAccount` |
| `hoozinSocialLinkLinkedInID`   | `Text`      | LinkedIn account link         | `LinkedInAccount`   |
| `hoozinSocialLinkSkypeID`      | `Text`      | Skype login                   | `SkypeAccount`      |
| `hoozinSocialLinkTwitterID`    | `Text`      | Twitter account link          | `TwitterAccount`    |
| `hoozinSocialLinkViadeoID`     | `Text`      | Viadeo account link           | `ViadeoAccount`     |
| `l`                            | `Text`      | Company city                  | `City`              |
| `description`                  | `MultiLine` | User description              | `Description`       |
| `postalAddress`                | `Text`      | Company address               | `PostalAddress`     |
| `postalCode`                   | `Text`      | Company zip code              | `PostalCode`        |
| `sn`                           | `Text`      | Last name                     | `LastName`          |
| `telephoneNumber`              | `Text`      | Office phone number           | `BusinessPhone`     |
| `mobilePhone`                  | `Text`      | Mobile phone number           | `MobilePhone`       |
| `title`                        | `Text`      | Job title                     | `Title`             |

## Sample scenario

Here's a typical scenario of adding a group of custom fields to a new section.

### Create a custom section

First, we'll add a new section called **About Me** in the second position on the user profile page, and we'll hide the group called **Company**.

```sql
INSERT USER_PROFILE_FIELD_GROUPS (FieldGroup, DefaultLabel, IsVisible, IsCustom, DisplayOrder) VALUES (N'AboutMe', N'About Me', 1, 1, 11)

/*** Hide group ***/
UPDATE USER_PROFILE_FIELD_GROUPS SET IsVisible = 0 WHERE FieldGroup = 'Company'
```

### Create custom fields

Now, we'll add a field called **Nickname** to the built-in **Name** group, right after the **Title** field. We'll also add the existing **Description** fiel&#x64;*,* and add a new tag field called **Hobbies** to the new **About Me** section.

```sql
INSERT USER_PROFILE_FIELDS (FieldName, DataType, DefaultLabel, IsSearchable, IsVisible, IsCustom, IsMandatory, DisplayOrder, Weight, FieldGroup, XmlNodeName, Watermark) VALUES (N'hoozinExtAttr001', N'Text', N'Nickname', 0, 1, 1, 0, 1, 0, N'Name', N'hoozinExtAttr001', NULL)

/*** Set last name and first name order ***/
UPDATE USER_PROFILE_FIELDS SET DisplayOrder = 2 WHERE FieldName = 'sn'
UPDATE USER_PROFILE_FIELDS SET DisplayOrder = 3 WHERE FieldName = 'givenName'

/*** Set group of description field ***/
UPDATE USER_PROFILE_FIELDS SET FieldGroup = 'AboutMe' WHERE FieldName = 'description'

/*** Add new field « Hobbies » ***/
INSERT USER_PROFILE_FIELDS (FieldName, DataType, DefaultLabel, IsSearchable, IsVisible, IsCustom, IsMandatory, DisplayOrder, Weight, FieldGroup, XmlNodeName, Watermark) VALUES (N'hoozinExtAttrMulti001', N'Tags', N'Hobbies', 0, 1, 1, 0, 1, 0, N'AboutMe', N'hoozinExtAttrMulti001', NULL)
```

{% hint style="warning" %}
**The user profile schema is cached**. Recycle IIS pools from IIS console or run a `iisreset` shell command to reset the hoozin cache and see your changes in the user profile page.
{% endhint %}
