We'd love to hear from you! Provide  feedback  to earn a badge today. Take our quick survey
You're almost there! Please answer a few more questions for access to the Applications content. Complete registration
Interested in joining? Complete your registration by providing Areas of Interest here. Register

Is it possible to access the value of a column of a table in Agent Desktop?

Accepted answer
7
Views
9
Comments
edited Feb 22, 2018 1:29PM in Integrations and APIs 9 comments

Content

So I have made an autocomplete for the KeywordText widget using awesomplete. The thing is I want the results to be in order of which questions are most popular. From what I gathered the static_score or the solve_count in the FAQs(asnwers) Table in Agent Desktop is a way to sort the answers. Is it possible to get those values for each answer? 

P.S. Now I am taking the answers through ROQL and place them in a list which I search through javascript as the user is typing.

Version

3.6.2

Code Snippet

             <script>
	var input = document.getElementById("rn_KeywordText_0_Text");
	var awesomplete = new Awesomplete(input, {
	minChars: 1,
	maxItems: 3,
	list: [
		<?
/* Check if sub domain lang to change query for a specific lang */
		$lang = "'en_US'";
		try{
			$query = "SELECT A.ID, A.Summary, A.Language.name as LanguageID, A.StatusWithType.StatusType.name as StatusType FROM Answer A where A.Language.name = ".$lang." LIMIT 250 OFFSET 0";
			$roql_res = RightNow\Connect\v1_3\ROQL::query($query)->next();

			while($res = $roql_res->next()) {
				echo "\"";
				echo $res['Summary'];
				echo "\",";
			}
		}catch(Exception $ex){
	
		}
		?>]
	});
  </script> 
        

Howdy, Stranger!

Log In

To view full details, sign in.

Register

Don't have an account? Click here to get started!