# My Favorites
Adds or removes SharePoint favorites for a user by processing rows from an Excel file. All rows for the same user are grouped and processed in a single update call.
Filename pattern: filename must contain myfavorites (case-insensitive).
Example: 20240115 myfavorites update.xlsx
# Columns
| Name | Required | Description |
|---|---|---|
| User / UserName | Yes | The user for whom favorites are added or removed. Rows are grouped by this value (case-insensitive). |
| ClientCode | No | Client code used together with MatterCode to identify the matter. |
| MatterCode | No | Matter code. When provided, Url and SiteUrl are resolved from the matter list. |
| Title | No | Display name for the favorite. When not provided and MatterCode is set, defaults to the matter title combined with the doclib folder name. |
| TargetFolder / Folder | No | Subfolder within the matter doclib to use as the favorite URL. Appended to the resolved doclib URL. |
| Url | No | Direct URL of the favorite target. When MatterCode is provided, this is resolved automatically from the matter list. |
| SiteUrl | No | Site URL for the favorite. When MatterCode is provided, resolved from the matter list. |
| Remove / Delete | No | Boolean. When true, the favorite is removed. When false or omitted, the favorite is added. |
User is always required per row.
# Behavior
All rows for the same User (compared case-insensitively) are batched together and submitted in a single call to MyFavoritesList.Update().
When MatterCode is provided:
- Url is resolved to the matter doclib URL, with TargetFolder appended if specified.
- SiteUrl is resolved from the
SiteURLfield of the matter list item. - Title defaults to the matter title followed by the last segment of the doclib URL.
# Related links
- My Matters handler — add or remove matters from a user's My Matters list