SPScriptedFacet - Scoped
-
- UpdatedJan 30, 2025
- 1 minute read
- Yokohama
- API reference
Defines facet items, filters, or mapped queries for a facets object.
You can only use the SPScriptedFacet API in a facet generation script in a Service Portal search source. The facet generation script is only visible when Is scripted source is selected.
There is no constructor for this class. Instead, use the createFacet() or createMultiChoiceFacet() methods of the SPScriptedFacetService class to generate a facets object.
SPScriptedFacet - addFacetItem(String label, Object valueObj)
Adds facet items or mapped queries to a facets object.
Before adding facet items to a facets object, create the facets object using the createFacet() or createMultiChoiceFacet() methods of the SPScriptedFacetService class.
Name | Type | Description |
---|---|---|
label | String | The display label for the facet item or mapped query. |
valueObj | Object | The facet item or mapped query for the facet. Can only contain types String, Number, Boolean, and Double. |
Type | Description |
---|---|
void |