{"revision":"c10276e953456835cdbb1f3a60d58ae1980be353","document":{"id":7145,"path":"customer-service-management/ra-csm-config-data-broker.md","title":"Configure force refresh for recommendations","bundle":null,"doc_type":null,"release":"australia","body":"\n# Configure force refresh for recommendations\n\nConfigure the **Trigger Recommendation Refresh** data broker to refresh and update the recommendations based on the results from UI events for precise recommendations. Similarly, use the `ForceRefreshRecommendations` method for configuring an explicit refresh mechanism.\n\n## Before you begin\n\nRole required: sn\\_nb\\_action.next\\_best\\_action\\_author, or admin\n\n## About this task\n\nPrior to the Zurich family release, the recommendations often remain outdated due to refresh triggers being tied only to updates on primary context records. Starting with the Zurich family release, you can configure explicit and event-driven refreshes for various context updates beyond just the primary context table to improve recommendations relevance.\n\n-   Explicit refresh mechanism: Enables you to trigger recommendation refreshes manually, independent of internal context changes, addressing scenarios where event-driven updates are insufficient.\n\n    Call the `ForceRefreshRecommendations` method. The `ForceRefreshRecommendations` method is shipped with the base system as part of the **NextBestActionServiceImpl** script include.\n\n    `ForceRefreshRecommendations` method:\n\n    ```\n    sn_nb_action.NextBestActionService().forceRefreshRecommendations(input.ruleContextSysIds, input.currentRecordSysId, input.refreshAllUsers);\n    ```\n\n-   Event-driven refresh: Implements automatic recommendations updates triggered by predefined system events such as attribute changes on related tables or user interactions like button clicks or tab navigation.\n\n    Configure the **Trigger Recommendation Refresh** data broker of a UI component in the UI builder. This data broker is shipped with the base system and is available for all the UI components of the record pages. Perform the following steps to configure this data broker.\n\n\n## Procedure\n\n1.  Navigate to **All** &gt; **Now Experience Framework** &gt; **UI builder**.\n\n2.  In the UI builder, open the **Workspace** experience which you want update.\n\n3.  Open the record page containing the UI component for which you want to configure the data broker.\n\n4.  In the content tree, select a UI component.\n\n    A panel opens on the right with Configure, Style and Events tabs.\n\n5.  In the Events tab, select **Execute Data Resource - Trigger Recommendation Refresh 1**.\n\n6.  On the Configure modal, set the following properties.\n\n<table id=\"table_z4v_sh3_yfc\"><thead><tr><th>\n\nProperty\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nRule Context SysIds\n\n</td><td>\n\nSysid of the rule context records that must be applied to the UI component. The recommendations of these rules are reflected in the recommendations tab when the event is triggered. This property is of String array type.\n\n</td></tr><tr><td>\n\nCurrent Record SysId\n\n</td><td>\n\nSysid of the record to which you want to associate the UI event.This property is of String type.\n\n</td></tr><tr><td>\n\nRefresh All Users\n\n</td><td>\n\nRefreshes recommendations for all the active agent, when set to true. By default, the value is set to false.This property is of Boolean type.\n\n</td></tr></tbody>\n</table>7.  In the **When to trigger** drop-down, select one of the following.\n\n<table id=\"choicetable_eqc_b33_yfc\"><thead><tr><th align=\"left\" id=\"d86141e231\">\n\nOption\n\n</th><th align=\"left\" id=\"d86141e234\">\n\nDescription\n\n</th></tr></thead><tbody><tr><td id=\"d86141e240\">\n\n**Always**\n\n</td><td>\n\nTriggers the refresh every time there’s an update.\n\n</td></tr><tr><td id=\"d86141e249\">\n\n**Conditional**\n\n</td><td>\n\nTriggers the refresh when the defined condition is met.Define the condition in the **Event Handler condition** field.\n\n</td></tr></tbody>\n</table>8.  Select **Apply** in the Configure modal.\n\n\n## Result\n\nWhen the configured component is triggered, the recommendations are refreshed and updated accordingly in the CSM/FSM Configurable Workspace.\n\n"}}