Skip to content

Commit 7f3f5e2

Browse files
[Excel] (Custom functions) Add new JSDoc tags and metadata reference info (#5240)
* [Excel] (Custom functions) Add streaming tags * Undo changes to autogenerate article * Add new tags to autogen article * Add load service description * Add tags to JSON metadata article * Add custom enum info to JSON articles * Add custom enums to manual json article * Add customEnumType to parameters reference * Minor edits * Fix syntax error * Capitalize Boolean to align with style guide * Fix incorrect sentence * Incorporate review feedback * Fix broken link * Apply suggestions from code review Co-authored-by: David Chesnut <[email protected]> * Add second enum to JSON snippet * Apply suggestions from code review Co-authored-by: David Chesnut <[email protected]> --------- Co-authored-by: David Chesnut <[email protected]>
1 parent 3c93c0a commit 7f3f5e2

File tree

4 files changed

+164
-27
lines changed

4 files changed

+164
-27
lines changed

docs/excel/custom-functions-custom-enums.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Custom enums give users Excel AutoComplete options for your custom functions. Th
1616
Define your enum with the JSDoc tag `@customenum`. The corresponding JSON properties are then autogenerated in your custom function metadata. For more information about JSDoc tags and custom functions, see [Basics of JSDoc tags](custom-functions-json-autogeneration.md#basics-of-jsdoc-tags).
1717

1818
> [!NOTE]
19-
> Custom enums created with the `@customenum` JSDoc tag are only supported in TypeScript. They are not supported in JavaScript. To use custom enums with JavaScript functions, you must manually create your own JSON metadata. To learn more, see [Manually create JSON metadata](custom-functions-json.md).
19+
> Custom enums created with the `@customenum` JSDoc tag are only supported in TypeScript. They are not supported in JavaScript. To use custom enums with JavaScript functions, you must manually create your own JSON metadata. To learn more, see [Manually create JSON metadata: enums](custom-functions-json.md#enums).
2020
2121
The following code snippet shows how to define and use a simple custom enum as a parameter.
2222

docs/excel/custom-functions-json-autogeneration.md

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Autogenerate JSON metadata for custom functions
33
description: Use JSDoc tags to dynamically create your custom functions JSON metadata.
4-
ms.date: 06/15/2025
4+
ms.date: 06/19/2025
55
ms.localizationpriority: medium
66
---
77

@@ -92,8 +92,12 @@ In the following example, the phrase "Calculates the volume of a sphere." is the
9292
The following JSDoc tags are supported in Excel custom functions.
9393

9494
- [@cancelable](#cancelable)
95+
- [@capturesCallingObject](#capturesCallingObject)
96+
- [@customenum](#customenum) *{type}*
9597
- [@customfunction](#customfunction) *id* *name*
98+
- [@excludeFromAutoComplete](#excludeFromAutoComplete)
9699
- [@helpurl](#helpurl) *url*
100+
- [@linkedEntityLoadService](#linkedEntityLoadService)
97101
- [@param](#param) *{type}* *name* *description*
98102
- [@requiresAddress](#requiresAddress)
99103
- [@requiresParameterAddresses](#requiresParameterAddresses)
@@ -114,6 +118,20 @@ If the last function parameter is of type `CustomFunctions.CancelableInvocation`
114118

115119
A function can't have both `@cancelable` and `@streaming` tags.
116120

121+
<a id="capturesCallingObject"></a>
122+
123+
### @capturesCallingObject
124+
125+
This tag works with Excel [data types](excel-data-types-overview.md). It specifies that the data type being referenced by the custom function is passed as the first argument to the custom function. For more information, see [Reference the entity value as a calling object](excel-add-ins-dot-functions.md#reference-the-entity-value-as-a-calling-object).
126+
127+
<a id="customenum"></a>
128+
129+
### @customenum
130+
131+
Syntax: @customenum *{type}*
132+
133+
This tag indicates that a set of values is a custom enum. For more information, see [Create custom enums for your custom functions](custom-functions-custom-enums.md).
134+
117135
<a id="customfunction"></a>
118136

119137
### @customfunction
@@ -183,6 +201,14 @@ In the following example, the phrase "A function that adds two numbers" is the d
183201
*/
184202
```
185203

204+
<a id="excludeFromAutoComplete"></a>
205+
206+
### @excludeFromAutoComplete
207+
208+
The `@excludeFromAutoComplete` tag ensures that the custom function doesn't appear in the formula AutoComplete menu in Excel. For more information, see [Exclude custom functions from the Excel UI](excel-add-ins-dot-functions.md#exclude-custom-functions-from-the-excel-ui).
209+
210+
A function can’t have both `@excludeFromAutoComplete` and `@linkedEntityLoadService` tags.
211+
186212
<a id="helpurl"></a>
187213

188214
### @helpurl
@@ -202,6 +228,14 @@ In the following example, the `helpurl` is `http://www.contoso.com/weatherhelp`.
202228
*/
203229
```
204230

231+
<a id="linkedEntityLoadService"></a>
232+
233+
### @linkedEntityLoadService
234+
235+
The `@linkedEntityLoadService` tag designates that the function is a linked entity load service that returns [linked entity cell values](excel-data-types-linked-entity-cell-values.md) for linked entity IDs requested by Excel.
236+
237+
A function can’t have both `@excludeFromAutoComplete` and `@linkedEntityLoadService` tags.
238+
205239
<a id="param"></a>
206240

207241
### @param

0 commit comments

Comments
 (0)