Gravatar for vikas@italentdigital.com

Question by Vikas_Sachdeva, Oct 10, 2018 6:03 PM

How to index attachments in salesforce that are only attached to cases?

Hello,

I am looking to filter out attachments in the salesforce connector that are not associated with cases. Coveo does not provide any attributes to identify the type of parent.

Salesforce does provide a mechanism as shown below:

SELECT Id, Name, ParentId, Parent.Type FROM Attachment where Parent.Type = 'Case'


How can I incorporate Parent.Type in Coveo configuration?

Please help.

Cheers,

Vikas

Gravatar for gminero@coveo.com

Comment by gminero, Oct 10, 2018 6:42 PM

have you tried adding a parent relationshipt to the attachment and create a mapping for the parent.type ? https://docs.coveo.com/en/1785/cloud-v2-administrators/understanding-the-json-salesforce-objects-section

1 Reply
Gravatar for erocheleau@coveo.com

Answer by Etienne, Oct 10, 2018 7:05 PM

You can almost do that with the UI, we have a way to do conditional indexation especially for this exact use case:

You can use the UI to add a condition on Attachments objects however the Parent.Type will not be available in the dropdown, so I suggest doing Parent.Name = 'Case' and then select your source and click edit JSON:

It will look like this in the Object section after you scroll to find Attachments:

,
        "Conditions": {
          "queryConditionOrQueryCondition2OrInCondition": [
            {
              "QueryCondition": {
                "Field": "Parent.Type",
                "Operator": "=",
                "Value": "'Case'"
              }
            }
          ]
        }
Gravatar for gminero@coveo.com

Comment by gminero, Oct 10, 2018 7:08 PM

interesting, becasue parent.type does not appear under the available fields when using the ui's conditions

Gravatar for vikas@italentdigital.com

Comment by Vikas_Sachdeva, Oct 10, 2018 7:38 PM

Thanks for the example. I saw the same situation as Guillaume that "Type" field does not appear in the UI, even if added to the JSON.

So I added the condition of 'Case' to Parent.Name, but the JSON reflected Parent.Name='Case', so I changed it to Parent.Type='Case' and it worked. Thanks

Gravatar for vikas@italentdigital.com

Comment by Vikas_Sachdeva, Oct 10, 2018 7:42 PM

Can I add complex conditions using "In" clause, AND, OR etc in JSON? Cheers, Vikas

Gravatar for vikas@italentdigital.com

Comment by Vikas_Sachdeva, Oct 10, 2018 7:49 PM

If my requirement was a bit more specific i.e. index only those attachments that are associated with case of a certain record type. Is this possible?

Case object does have a field in Coveo that reflects the record type.

Cheers,

Vikas

Ask a question