|
1 | 1 | ---
|
2 | 2 | title: Manually create JSON metadata for custom functions in Excel
|
3 | 3 | description: Define JSON metadata for custom functions in Excel and associate your function ID and name properties.
|
4 |
| -ms.date: 10/10/2022 |
| 4 | +ms.date: 06/15/2025 |
5 | 5 | ms.localizationpriority: medium
|
6 | 6 | ---
|
7 | 7 |
|
@@ -142,6 +142,8 @@ The `allowCustomDataForDataTypeAny` property is a boolean data type. Setting thi
|
142 | 142 | > [!NOTE]
|
143 | 143 | > Unlike most of the other JSON metadata properties, `allowCustomDataForDataTypeAny` is a top-level property and contains no sub-properties. See the preceding [JSON metadata code sample](#json-metadata-example) for an example of how to format this property.
|
144 | 144 |
|
| 145 | +If your custom function uses the `cellValueType` [parameter](#parameters), then setting the `allowCustomDataForDataTypeAny` isn't required to accept data types as parameters and return values. |
| 146 | + |
145 | 147 | ### allowErrorForDataTypeAny
|
146 | 148 |
|
147 | 149 | The `allowErrorForDataTypeAny` property is a boolean data type. Setting the value to `true` allows a custom function to process errors as input values. All parameters with the type `any` or `any[][]` can accept errors as input values when `allowErrorForDataTypeAny` is set to `true`. The default `allowErrorForDataTypeAny` value is `false`.
|
@@ -185,9 +187,24 @@ The `parameters` property is an array of parameter objects. The following table
|
185 | 187 | | `dimensionality` | string | No | Must be either `scalar` (a non-array value) or `matrix` (a 2-dimensional array). |
|
186 | 188 | | `name` | string | Yes | The name of the parameter. This name is displayed in Excel's IntelliSense. |
|
187 | 189 | | `type` | string | No | The data type of the parameter. Can be `boolean`, `number`, `string`, or `any`, which allows you to use of any of the previous three types. If this property is not specified, the data type defaults to `any`. |
|
| 190 | +| `cellValueType` | string | No | A subfield of the `type` property. Specifies the Excel data types accepted by the custom function. Accepts the case-insensitive values `cellvalue`, `booleancellvalue`, `doublecellvalue`, `entitycellvalue`, `errorcellvalue`, `linkedentitycellvalue`, `localimagecellvalue`, `stringcellvalue`, and `webimagecellvalue`. <br/><br/>The `type` field must have the value `any` to use the `cellValueType` subfield. | |
188 | 191 | | `optional` | boolean | No | If `true`, the parameter is optional. |
|
189 | 192 | |`repeating`| boolean | No | If `true`, parameters populate from a specified array. Note that functions all repeating parameters are considered optional parameters by definition. |
|
190 | 193 |
|
| 194 | +> [!TIP] |
| 195 | +> See the following code snippet for an example of how to format the `cellValueType` parameter in JSON metadata. |
| 196 | +> |
| 197 | +> ```json |
| 198 | +> "parameters": [ |
| 199 | +> { |
| 200 | +> "name": "range", |
| 201 | +> "description": "the input range", |
| 202 | +> "type": "any", |
| 203 | +> "cellValueType": "webimagecellvalue" |
| 204 | +> } |
| 205 | +> ] |
| 206 | +> ``` |
| 207 | +
|
191 | 208 | ### result
|
192 | 209 |
|
193 | 210 | The `result` object defines the type of information that is returned by the function. The following table lists the properties of the `result` object.
|
|
0 commit comments