The CreatorCon Call for Content is officially open! Get started here.

Hide unpublished kb articles on the service portal for users

Phil4
Mega Contributor

The business has asked if it is possible to hide unpublished knowledge articles on the Service Portal for users but not affect the back end client search. The requirement is so that users have the same experience as customers do when using the portal, 

I understand the following setting within properties, but unticking this option will not allow users to search related articles within incidents etc. 

find_real_file.png

Our portal has been setup to use a Typehead Search widget with SNC.SearchRequest and from what I understand there would be no way to pass a parameter into it to only return published articles as the following seems to be the only rules that can be applied

  • knowledgeBase
  • topic
  • category
  • language
  • department

I might be looking at this from the wrong perspective so any help directing me to another way of doing this would be greatly appreciated.

1 ACCEPTED SOLUTION

Phil4
Mega Contributor

For anyone interested in knowing the outcome - I was looking at it the completely wrong way.

 

I was given a lead to look at the Service Portal -> Search Sources

In my Knowledge search source I was able to add an extra part to the encoded query -  + "^workflow_state=published".

Adding this removed the results from the search and from the categories listing but had no affect on the client side.

 

Using ACLs or User Criteria did not work 

View solution in original post

9 REPLIES 9

Pratiksha Kalam
Kilo Sage

Hello,

You can achieve it by creating a user criteria in "user_criteria" table and you can add this User Criteria in the "Can Read" or "Cannot Read" field on knowledge article record.

User Criteria

 

If answer is helpful mark correct!

Thanks,

Pratiksha

Phil4
Mega Contributor

Thank you for the response.

I will try something like the following in can read(?) to see if it will work. Do you know if the User Criteria has access to the current object? The other option I am thinking is to flip it and add it to the can not read.

checkCondition();

function checkCondition(){

if(window === null && current.getValue('workflow_state') != 'published')
return false;
else
return true;
}

 

I will let you know how I go.

Phil4
Mega Contributor

For anyone interested in knowing the outcome - I was looking at it the completely wrong way.

 

I was given a lead to look at the Service Portal -> Search Sources

In my Knowledge search source I was able to add an extra part to the encoded query -  + "^workflow_state=published".

Adding this removed the results from the search and from the categories listing but had no affect on the client side.

 

Using ACLs or User Criteria did not work 

SR20
Tera Contributor

Hi Phil,

 

I was reading this thread and wanted to know where did you added the condition in script include server script you mean, do you thing you can share little more details ?

Thanks for your help!