*** title: How to Configure Salesforce Knowledge Ingestion using Generic Adapter excerpt: >- The Generic Adapter enables seamless content ingestion from any external system not natively listed, including platforms such as Salesforce deprecated: false hidden: true metadata: robots: index ------------- **Note:** While the Generic Adapter is designed to ingest content from any non-listed system, the configuration steps and examples in this specific guide are tailored for **Salesforce** integration. Please reach out to the Moveworks Support about leveraging the Adapter for other non-listed systems ## Pre-Requisites Please ensure the required Salesforce Connector has been created with the necessary permissions. Please refer the [Salesforce Access Requirements](/service-management/access-requirements/ticketing-systems-itsms/salesforce) Doc for details. Please ensure the required Salesforce Connector has been created with the necessary permissions. Please refer the [Salesforce Access Requirements](/service-management/access-requirements/ticketing-systems-itsms/salesforce) Doc for details. Please ensure the API credentials being used for connecting to Salesforce have access to the Knowledge API and necessary objects. ## Configuration Start by creating a new Ingestion under **Answers > Ingestion > Internal Knowledge Settings** First, select the Connector created for the ingestion and then provide a name for the ingestion under **Ingestion Name**. Then, choose a **Domain**. The domain is the functional areas of employee service that is most related to the knowledge being ingested for this configuration. ## Setup Knowledge Bases in Advanced Mode In the Advanced mode, in order to ingest knowledge articles from Salesforce Knowledge, we need to select the System as **Generic Config**. The Generic Config allows us to ingest content from an API response. This is done by mapping the Response to the Moveworks Internal Attributes. With this, we are able to call a start URL, fetch the content details and map it internally. ### Start URL Configuration Configure the Start URL to point to your Salesforce Knowledge Article API endpoint: ``` https://.salesforce.com/services/data/v58.0/query?q=SELECT+Id,Title,UrlName,Summary,ArticleNumber,CreatedDate,LastModifiedDate,LastPublishedDate,ArticleCreatedById,ArticleCaseAttachCount+FROM+KnowledgeArticleVersion+WHERE+PublishStatus='Online'+AND+Language='en_US'+ORDER+BY+LastModifiedDate+DESC+LIMIT+200 ``` Define the Type of content which will be received from the URL. In this case, the Content type being returned is an **KNOWLEDGE\_URL\_TYPE\_ARTICLE\_LIST** which includes the knowledge articles. ![](https://files.readme.io/e88a47a725d8bc65ed92bb6cba2544a35f9ffcb5abb426dfa95f3b0ab122f78b-image.png)
Now that we have configured the Start URL and the Type of Content Moveworks can expect, we now need to map the API response to the internal Moveworks Mapping Attributes in order to successfully process the content. ## Response Mapper Configuration ### Response Mapper for KNOWLEDGE\_URL\_TYPE\_ARTICLE\_LIST Let's start by mapping the `KNOWLEDGE_URL_TYPE_ARTICLE_LIST`. You would need to select this as the Type in Response Mapper. This mapper handles pagination and extracts knowledge articles from the Salesforce response: ```json { "knowledge_urls": { "CONDITIONAL()": { "condition": "NOT(NOT(response.nextRecordsUrl))", "on_pass": [ { "parsed_url": { "base_url": { "CONCAT()": { "separator": "\"\"", "items": "[\"https://.salesforce.com\", response.nextRecordsUrl]" } } }, "type": "\"ARTICLE_LIST\"", "method": "\"GET\"" } ], "on_fail": "[]" } }, "knowledge_articles": { "CONDITIONAL()": { "condition": "NOT(NOT(response.records))", "on_pass": "response.records", "on_fail": "[]" } } } ``` **Explanation:** * The `knowledge_urls` section checks if there's a `nextRecordsUrl` in the response (indicating more pages of results) * If pagination exists, it constructs the next URL to fetch * The `knowledge_articles` section extracts the actual article records from the response ## Article Mapper Configuration Once the Response Mapper has been configured, we need to define the final **Article Mapper** that transforms each Salesforce Knowledge Article into the Moveworks internal format: ```json { "created_at": "$TIMECONV(CreatedDate)", "article_id": "Id", "display_id": "ArticleNumber", "article_visibility": "\"VISIBLE\"", "article_class": "\"KNOWLEDGE_PAGE\"", "article_hierarchies": [ { "tier_values": { "CONDITIONAL()": { "condition": "NOT(NOT(ArticleType))", "on_pass": "[ArticleType]", "on_fail": "[\"\"]" } }, "tier_label": "\"CATEGORY\"" } ], "title": "Title", "updated_at": "$TIMECONV(LastModifiedDate)", "article_url": { "CONCAT()": { "separator": "\"/\"", "items": "[\"https://.salesforce.com/lightning/r/Knowledge__kav\", Id, \"view\"]" } }, "article_state": "\"PUBLISHED\"", "body": { "COALESCE()": { "items": [ "Summary", "\"\"" ] } }, "author_ids": { "CONDITIONAL()": { "condition": "NOT(NOT(ArticleCreatedById))", "on_pass": "[ArticleCreatedById]", "on_fail": "[]" } }, "language": "\"EN\"" } ``` **Field Mapping Explanation:** * **article\_id**: Maps to Salesforce's `Id` field (unique identifier for the article version) * **display\_id**: Maps to `ArticleNumber` (user-friendly article number) * **title**: Maps to the `Title` field * **body**: Maps to the `Summary` field (or you can use custom fields like `Description__c`) * **article\_url**: Constructs the Lightning Experience URL for the article * **article\_hierarchies**: Maps to `ArticleType` for categorization * **author\_ids**: Maps to `ArticleCreatedById` for author information * **created\_at/updated\_at**: Converts Salesforce timestamps to Moveworks format ### Customizing for Your Salesforce Instance You may need to customize the mappers based on your specific Salesforce configuration: 1. **Custom Fields**: If you're using custom fields in your Knowledge Articles (e.g., `Custom_Body__c`, `Department__c`), update the mapper accordingly: ```json { "body": "Custom_Body__c", "article_hierarchies": [ { "tier_values": "[Department__c]", "tier_label": "\"DEPARTMENT\"" } ] } ``` 2. **Multiple Languages**: If you support multiple languages, adjust the SOQL query in the Start URL and add language mapping: ```json { "language": { "CONDITIONAL()": { "condition": "Language == \"en_US\"", "on_pass": "\"EN\"", "on_fail": { "CONDITIONAL()": { "condition": "Language == \"es\"", "on_pass": "\"ES\"", "on_fail": "\"EN\"" } } } } } ``` 3. **Data Categories**: If you use Salesforce Data Categories for organization, you can add them to `article_hierarchies`: ```json { "article_hierarchies": [ { "tier_values": "[ArticleType]", "tier_label": "\"CATEGORY\"" }, { "tier_values": { "CONDITIONAL()": { "condition": "NOT(NOT(DataCategorySelections))", "on_pass": { "MAP()": { "items": "DataCategorySelections", "converter": "item.DataCategoryName" } }, "on_fail": "[]" } }, "tier_label": "\"SUBCATEGORY\"" } ] } ``` ## Advanced Configuration: Filtering Articles You can modify the Start URL SOQL query to filter which articles get ingested: **Filter by Article Type:** ``` WHERE+PublishStatus='Online'+AND+ArticleType='FAQ__kav'+AND+Language='en_US' ``` **Filter by Date:** ``` WHERE+PublishStatus='Online'+AND+LastModifiedDate>=2024-01-01T00:00:00Z ``` **Filter by Custom Field:** ``` WHERE+PublishStatus='Online'+AND+Include_In_Chatbot__c=true ``` ## Adding Permissions for the Salesforce Content In order to serve ingested knowledge in the Assistant, we need to enable permissions for the Connector which is being used to ingest the Knowledge. Navigate to **Resource Permissions > Permissions Rules** under the Core Platform module. Click on **Create**. Here we need to define the following fields: * **Strategy Config**: Public to all members of the organization * **Integration Id**: Name of the connector for Salesforce * **Resource Type**: kb * **Action**: ACTION\_VIEW ## Validation Once you have submitted the Knowledge ingestion configuration, it will kick off the Ingestion pipeline in the background. The status of the same can be tracked on the **Ingested Knowledge View**. You can search for the Articles with their Titles here, and if they are listing on the Console, that means they have been ingested successfully. ### Troubleshooting Common Issues 1. **No Articles Ingested**: * Verify the Salesforce connector has proper API access * Check that the SOQL query returns results when run directly in Salesforce * Ensure the service account has "View All" permission on Knowledge Articles 2. **Missing Fields**: * Verify all fields referenced in the Article Mapper exist in your Salesforce Knowledge Article object * Check field-level security settings in Salesforce 3. **Pagination Issues**: * Ensure the `nextRecordsUrl` handling in the Response Mapper is correct * Verify the base URL matches your Salesforce instance URL 4. **Permission Errors**: * Confirm the Resource Permission rule is properly configured * Verify the Integration Id matches exactly with your connector name ***