Query extension samples

This is for:

Developer
In this article

Here are some sample use cases for query extensions.

Service and support

The following samples would be used in a Coveo for Salesforce Insight Panel.

Next issue avoidance

  • Returns parent cases of related cases:

    (NOT @syssfid=={!>id})
    (NOT @syssfcaseid=={!>id})
    
    {{relatedCases = @objecttype=="Case" $some(keywords: '{!>Subject}', match:1) @sfparentcasenumber $correlateResultSet(resultSet: @syssfid=={!Id}, field: '@sysconcepts', maximumValues: '25', modifier: '1000')}} 1
    
    $valuesToResultSet(values: $valuesOfField(field: '@sfparentcasenumber', resultSet: {{relatedCases}}), field: '@sfcasenumber') 2
    1 Get the parent cases.
    2 Extract the parent cases from the related cases.
  • Returns knowledge docs related to parent cases of related cases:

    (NOT @syssfid=={!>id})
    (NOT @syssfcaseid=={!>id})
    
    {{relatedCases = @objecttype=="Case" $some(keywords: '{!>Subject}', match:1) @sfparentcasenumber $correlateResultSet(resultSet: @syssfid=={!Id}, field: '@sysconcepts', maximumValues: '25', modifier: '1000')}} 1
    
    {{parentCases = $valuesToResultSet(values: $valuesOfField(field: '@sfparentcasenumber', resultSet: {{relatedCases}}), field: '@sfcasenumber' )}} 2
    
    $some(keywords:$removeStopWords(keywords:$anyKeywords(keywords:$valuesOfField(field: '@title', resultSet: {{parentCases}})))) 3
    1 Extract related cases.
    2 Extract parent cases of related cases.
    3 Find some relevant knowledge.