What I'm Trying to Accomplish

We are trying to import all of our self help documentation (held on another website) into our SalesForce knowledge base. Our self help "articles" are grouped by related tags.

Where I'm At

Currently I have all articles( via JSON), can input articles into Salesforce (Using JSForce), and am now looking to attach multiple "Topics" onto the newly created/migrated articles that will be moving to Salesforce to better link our articles for searching by our end users.

I've seen the object model of articles: https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_erd_knowledge.htm

However im fuzzy on how topics connect to articles.

Stuff I don't know

  • Are multiple topics the best way to link articles for search in the community?
  • Where/How do i even find the object model for the link between Topics & Articles?
  • Is there a way through either API or APEX or any other way (except manually tagging each individual article) to attach multiple topics to an article? If so can you show me an example?

1 Answer 1


The Salesforce Knowledge Developer Guide contains a list of sObjects and resources you might need to know in order to precisely work with knowledge, you will notice that the TopicAssignment is in the list.

Topic Assignments Represents the assignment of a topic to a specific feed item, record, or file. This object is available in API version 28.0 and later

As pointed out by @cropredy, TopicAssignment contains a sample usage for you to refer to which you can adapt to your use case:

SELECT KnowledgeArticleId FROM KnowledgeArticleVersion
WHERE publishStatus = 'Online' AND language = 'en_US'
AND  Id in (select EntityId from TopicAssignment where TopicId ='0T0xx0000000xxx')

Obviously, the above will not tag an article with a topic, but you get the idea. EntityId seems to be the link you are looking for.

As per an example, unfortunately, I don't have one, but the above resources should get you started.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .