Skip to main content
Build the future with Agentforce at TDX in San Francisco or on Salesforce+ on March 5–6. Register now.
예상 시간

Add an Action to Update the Opportunity

Update the Opportunity with the Discount and Finish the Flow

Once the flow has determined which discount to apply, it needs to return that information back to the opportunity so that the sales rep knows how much of a discount to offer the customer. Let’s update the opportunity with the value of the discount variable by using an Update Records element.

In an Update Records element, the flow does two things. First, it looks up one or more Salesforce records by using criteria. Second, it updates one or more of the record’s fields. The Update Records element updates every record that meets the criteria.

Here, the flow finds an opportunity record whose ID matches the flow variable OpportunityId. Remember, that’s where you stored the ID of the opportunity that triggered the flow. Because IDs are unique, the flow only updates one opportunity. Then it sets the opportunity’s Discount Percentage field to the value of the Discount variable.

  1. After the paths merge, click Add Element.
  2. Click Update Records.
  3. For Label, enter Update Discount Field.
  4. For How to Find Records to Update and Set Their Values, select Specify conditions to identify records, and set fields individually.
  5. For Update Records of This Object Type, select Opportunity.
  6. For Condition Requirements, select All Conditions Are Met (AND).
  7. In Filter Opportunity Records, configure the filter criteria to find the opportunity that triggered the flow.
    • For Field, select Id.
    • For Operator, select Equals.
    • For Value, select OpportunityId.
  8. In Set Field Values for the Opportunity Records, configure the element to update the opportunity’s Discount Percentage field with the value stored in the Discount variable.
    • For Field, select Discount Percentage.
    • For Value, select Discount

The New Update Records panel corresponding to the preceding steps.

  1. Click Save.

Here’s what your finished flow should look like.

A view of the Flow Builder canvas with a finished flow.

Salesforce 도움말에서 Trailhead 피드백을 공유하세요.

Trailhead에 관한 여러분의 의견에 귀 기울이겠습니다. 이제 Salesforce 도움말 사이트에서 언제든지 새로운 피드백 양식을 작성할 수 있습니다.

자세히 알아보기 의견 공유하기