Newer Version Available

This content describes an older version of this product. View Latest

Using Relationship Queries with Data Category Selection Objects

Data categories are used to classify records. In SOQL, you can use the Article__DataCategorySelection or QuestionDataCategorySelection objects. You can also build a relationship query with the DataCategorySelections relationship name in a FROM clause.

Imagine an Offer article type. The following query returns the ID of any categorization associated with an offer and the ID of the categorized article.

1SELECT Id,ParentId
2FROM Offer__DataCategorySelection

The following example uses the DataCategorySelections relationship name to build a relationship query that returns the ID of published offers and the ID of all the categorizations associated to these offers.

1SELECT Id, Title
2  (
3    SELECT Id
4    FROM DataCategorySelections
5  )
6FROM Offer__kav WHERE publishStatus='online';