---
schema_version: "1"
id: a9244c91821524695e9f1c37c0b3fea8af940d83e3322a499167cca84fb72494
title: Defining the Forecast Guidance You Receive from an Agent
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/sales/264-0-0/forecasts3_forecast_guidance_flow.md
canonical_url: https://help.salesforce.com/s/articleView?id=sales.forecasts3_forecast_guidance_flow.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 8880230eee3787725a59eb364c263c2e17a04a4ae1c088b04738681f3c0cea34
description: The Get Forecast Guidance agent action that sales managers can use to quickly view their sales rep’s forecasts is powered by a flow. Users with access can modify the flow in Flow Builder to control and better define the forecast insights they receive from the action. Define the formulas used, the number of opportunities shown, and the criteria for what makes an opportunity risky, in a way that brings the most value to sellers and managers.
products:
  - Sales Cloud
release: "264"
---
# Defining the Forecast Guidance You Receive from an Agent

The Get Forecast Guidance agent action that sales managers can use to quickly view their sales rep’s forecasts is powered by a flow. Users with access can modify the flow in Flow Builder to control and better define the forecast insights they receive from the action. Define the formulas used, the number of opportunities shown, and the criteria for what makes an opportunity risky, in a way that brings the most value to sellers and managers.

### Required Editions

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small edition"><colgroup><col></colgroup><tbody><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: <strong>Enterprise</strong>, <strong>Performance</strong>, and <strong>Unlimited</strong> Editions with the Einstein for Sales add-on</td></tr></tbody></table>

The Get Forecast Guidance flow is initiated when a user utterance associated with the Get Forecast Guidance action is sent to an agent. The flow then checks for specific forecast settings and preferences, computes the gap-to-quota for Commit and Most Likely, and pulls opportunities in both categories to assess if any are at risk.

## Constants

Given the size and complexity of the flow, we recommend modifying only the constant elements found in the flow. Constants store a fixed value to be used throughout a flow. Review the constants present in the Get Forecast Guidance flow and update values as needed to best align with how you want to receive forecast guidance.

  
| API Name | What It Stores | Default Value |
| --- | --- | --- |
| OpportunityScoreThreshold | The opportunity score threshold used to determine whether an opportunity is at risk. To use a different threshold, change 33 to the value you want to use. | 33 |
| EndOfPeriodThreshold | The ending time period within a forecasting period that qualifies an opportunity as risky based on the close date, as a percentage. To customize the end of the period, change 0.25 to the decimal value you want to use. | 0.25 |
| FutureActivitiesDateRange | The number of days beyond today’s date to use to determine which activities to consider for each opportunity at risk. To customize, change 90 to the value you want to use. | 90 |
| OpenServiceCasesThreshold | The number of open service cases used to determine whether an opportunity is at risk. To use a different threshold, change 0 to the value you want to use. | 0 |
| RiskFactorCountThreshold | The number of risk factors each opportunity can have before the opportunity is considered at risk. To use a different threshold, change 3 to the value you want to use. | 3 |
| ContactCountThreshold | The minimum number of contacts that is used to determine whether an opportunity is at risk. To use a different threshold, change 2 to the value you want to use. | 2 |
| AtRiskOpportunitiesToShowCount | The number of at risk opportunities to show in output. To include a different number, change 5 to the value you want to use. | 5 |

## Gap-to-Quota Calculations

Different formulas are used throughout the Get Forecast Guidance flow to calculate and determine whether a sales rep meets their quota for Commit and Most Likely. These formulas can be modified directly in the formula resource to best align with your business standards.

  
| API Name | What It Calculates | Default Formula |
| --- | --- | --- |
| DaysUntilEndOfPeriodAndOppCloseDateForCommitFormula | The difference between the end date of period from GetCurrentPeriod and the close date of the current opportunity in Commit. | {!GetCurrentPeriod.EndDate} - {!IterateOverOpportunitiesInCommit.CloseDate} |
| DaysUntilEndOfPeriodAndOppCloseDateForMostLikelyFormula | The difference between the end date of period from GetCurrentperiod and the close date of the current opportunity in most likely. | {!GetCurrentperiod.EndDate} - {!IterateOverOpportunitiesInMostLikely.CloseDate} |
| GapToCommitFormula | The amount of the gap between the target user’s quota and the target user’s Commit forecast. | {!GetForecastingQuota.QuotaAmount} - IF(ISNULL({!GetForecastingItemForCommit.ForecastAmount}), 0,{!GetForecastingItemForCommit.ForecastAmount}) |
| ConvertedGapToCommitFormula | The GapToCommit value in the running user’s preferred currency. | CURRENCYRATE({!GetForecastingUserPreference.ForecastingViewCurrency}) \* {!GapToCommitFormula} |
| GapToMostLikelyFormula | The amount of the gap between the target user’s quota and the target user’s Most Likely forecast. | {!GetForecastingQuota.QuotaAmount} - IF(ISNULL({!GetForecastingItemForMostLikely.ForecastAmount}), 0,{!GetForecastingItemForMostLikely.ForecastAmount}) |
| ConvertedGapToMostLikelyFormula | The GapToMostLikely value in the running user’s preferred currency. | CURRENCYRATE({!GetForecastingUserPreference.ForecastingViewCurrency}) \* {!GapToMostLikelyFormula} |
| PeriodTypeDurationRiskFormula | The number of days in the last EndOfPeriodThreshold percentage of the current period of the forecast context when an opportunity is considered to be at risk. To change the percentage of days that’s considered risky, change the value in EndOfPeriodThreshold. | CASE({!GetCurrentPeriod.Type}, "Week", 7, "Month", 30, "Quarter", 90, "Year", 365, 30) \* EndOfPeriodThreshold |
| RiskCriteriaPastEventDateRangeFormula | The date that’s PastActivitiesDateRange days before the current date. | {!$Flow.CurrentDate} - {!PastActivitiesDateRange} |
| RiskCriteriaFutureEventDateRangeFormula | The date that’s FutureActivitiesDateRange days after the current date. | {!$Flow.CurrentDate} + {!FutureActivitiesDateRange} |

## Agent Response

The forecast guidance you receive from an agent is generated from the forecastGuidance variable in the Get Forecast Guidance flow. The forecastGuidance variable pulls text from the various text templates included throughout the flow and uses those texts to populate the rich text response in the Agentforce side panel. To alter the language used in an agent’s response, change the variable value in the element using forecastGuidance.