Using a formula field to pull a data category value - Answers - Salesforce Trailblazer Community
Trailblazer Community
Ask Search:
Shawn BrennemanShawn Brenneman 

Using a formula field to pull a data category value

Hello,

We are currently using data categories on our knowledge base articles to help associate our products to each article. I have found that reporting on the data categories for a KB article is very cumbersome as you need one report for each category. It also lacks functionality as you can’t include the data category as a column and can't report on KB articles with no category defined.

I would like to create a formula field on the KB article that would pull the value assigned to our 'Product' data category. This would allow me to report on the field easier, and would allow me to report on KB's that have no 'Product' set in the data category.

Any help is appreciated.

Regards,
Shawn
 
James GoerkeJames Goerke

Shawn,

I echo your pain here. A formula is not going to be possible due to the data model between Knowledge and Data Categories. I did want to call out these Ideas:

https://success.salesforce.com/ideaView?id=08730000000l4SXAAY

https://success.salesforce.com/ideaView?id=08730000000DuDRAA0

I have this same problem so you inspired me to try and find a work around. Here's what I've come up with so far and I'll post more if I find anything else.

1) I setup a RollUp Helper which appears to be able to Roll Up Data Category into a custom Text Field. It's running now.

2) Data Category is setup as a child object (See above about the data model) so you should be able to trigger some Apex that would copy the data category into a custom field on the Article which you could then report on or improve via a Formula.

3) Implement a Multi-Select Picklist on the Article to mimic the Data Category - This option would require double entry and I really don't like that but it would allow you to report on the Data Category how to you need to.

Perhaps the community will have other thoughts.

I hope this helps! If it does, please consider marking it the best answer to help others looking for a solution to the same issue. 

Cheers,

James
 

Amonique BrownAmonique Brown
Hi Shawn,

I have the same need to report on data categories.  I am using the following console query as a workaround until a better solution can be found.

SELECT Id, urlName, ArticleNumber, Title, CreatedDate, publishStatus,
  (
    SELECT toLabel(DataCategoryName)
    FROM DataCategorySelections
  )
FROM KB__kav WHERE publishStatus = 'Online' and language = 'en_US' 
order by ArticleNumber desc

I put the output into excel and wrap the Id in the Excel Hyperlink function to create a link directly to each article.

Have you found any additional solutions since January?

Best,
Amonique
pavas singhalpavas singhal
Hi James, I have installed the rollup helper package and tried creating a custom formula field which can rollup the value from Data category but it doesnt seem to work on real time basis. Is it working for you? if yes can you share the details of the implementation.