Reassigning Records with a Flow

Last updated

Use a Before Save Flow to send records that Plauti Assign has already processed back to assignment when a condition is met.

Plauti Assign processes a record when its 'Use Plauti Assign' field (leadassist__Use_Round_Robin__c) is set to TRUE. To assign records for the first time when they meet a condition, for example when a Lead Status changes to Qualified, use Processing Rules. However, Processing Rules only evaluate records where 'Use Plauti Assign' is FALSE or empty. To reassign records that Plauti Assign has already processed before, use a record-triggered Flow instead. The approach works for any set of conditions that should result in reassignment.

When to use a Flow instead of Processing Rules

After Plauti Assign processes a record, the 'Use Plauti Assign' field shows the result: ASSIGNED, NOMATCH, QUEUED or REJECTED. Processing Rules skip records with these values. To have such a record processed again, 'Use Plauti Assign' must be set to TRUE manually or with automation, such as a Flow.

Use a Flow, for example, when:

  • Leads are first assigned to a qualification team and must be reassigned to a sales team once the qualification data is entered. See Multi Stage Sales Processes.
  • Cases must be reassigned when their Priority changes to High after they were first assigned.

Processing Rules and a Flow can be used for the same object. Processing Rules then handle the first assignment, and the Flow handles the reassignment.

Prerequisites

  • The object is configured in Plauti Assign, and Trigger Active is enabled for it in Object Configuration.
  • Match Groups exist that match the record after the change. If the record also still matches the Match Groups of its first assignment, give the Match Groups for the reassignment a higher priority. Read more in MatchGroups: Priority and Overflow.
  • You have permission to create and activate Flows in Salesforce.

Why a Before Save Flow

A Before Save Flow (a record-triggered Flow optimized for Fast Field Updates) runs during the save of the record, just before Plauti Assign runs. Plauti Assign then processes the record in the same save. This is the most efficient use of system resources. Because the Flow changes the record that is being saved, an Assignment element is all the Flow needs; no Update Records element is required.

Do not use an After Save Flow or Apex code to set Use Plauti Assign to TRUE for an object with active Processing Rules. These run after the save, in a separate update. Records that the Processing Rules already sent to assignment are then assigned twice.

1. Create the Flow

Create a record-triggered Flow that starts when a processed record meets your condition. The example values used in the steps below reassign a Lead when its custom Lead Type field (Lead_Type__c) is filled in or changed.

  1. Go to Salesforce Setup > Flows.
  2. Click New Flow.
  3. Create a new Record-Triggered Flow.
  4. At Object, select Lead (or your Object).
  5. At Trigger the Flow When, select A record is updated.
  6. At Condition Requirements, select All Conditions Are Met (AND).
  7. Add the conditions:
Field Operator Value
Use Plauti Assign (leadassist__Use_Round_Robin__c) Equals ASSIGNED
Lead Type (Lead_Type__c) Is Changed True
Lead Type (Lead_Type__c) Is Null False
  1. At Optimize the Flow for, select Fast Field Updates. This makes the Flow a Before Save Flow.
  2. Click Save.

The 'Is Changed' condition makes sure the record is only reassigned when the Lead Type changes, and not each time another field of the record is updated.

Choosing which Use Plauti Assign values to include

The example only reassigns records with the value ASSIGNED. Decide which values fit your process:

Value Meaning
ASSIGNED Plauti Assign assigned the record to an Assignee.
NOMATCH Plauti Assign inspected the record, but no Match Rules matched it or no Match Groups were active. Include this value if the change can make the record match a Match Group.
QUEUED All Assignees were unavailable, and the record is temporarily assigned to the Queue User. Plauti Assign already attempts reassignment every 10 minutes.
REJECTED The Assignee rejected the record. Plauti Assign does not bring rejected records up for reassignment.

To include more than one value, add a condition per value and use custom condition logic, for example (1 OR 2) AND 3 AND 4.

Do not include FALSE or empty. Use Processing Rules for records that have not been processed yet.

2. Set Use Plauti Assign to TRUE

Add an Assignment element that sets 'Use Plauti Assign' to TRUE, so Plauti Assign processes the record again.

  1. Below the Start element in the Flow, click the + icon.
  2. Select Assignment.
  3. At Label, enter a label, e.g., Set Use Plauti Assign to TRUE.
  4. At Variable, select {!$Record.leadassist__Use_Round_Robin__c}, or select 'Use Plauti Assign' from the 'Triggering Lead' fields.
  5. At Operator, select Equals.
  6. At Value, enter picklist value TRUE.
  7. Click Done.
  8. Click Save and Activate.

Checking the Flow

  1. Open a test record of your Object. For this example, open a Lead where 'Use Plauti Assign' is set to ASSIGNED.
  2. Change the record so that it complies with the Flow Trigger conditions and save the record. In the example, change the Lead Type field.
  3. Check the record. The owner should have changed to an Assignee of the matching Match Group, and the 'Use Plauti Assign' field should show ASSIGNED.

If 'Use Plauti Assign' shows NOMATCH, the Flow worked, but no Match Group matched the record. Check the Match Log.

Troubleshooting

Problem:

My Flow should send records back to Plauti Assign, but the record is not reassigned.

Answer:

Check the following, in this order:

  1. The Flow is active.
  2. The object has Trigger Active enabled in Plauti Assign's Object Configuration.
  3. Before the change, the value of 'Use Plauti Assign' on the record was one of the values in the Flow's entry conditions.
  4. The field in the 'Is Changed' condition has been changed, within the Save action that you expected to trigger the flow. If it was already changed earlier the Flow will not trigger in this case.
  5. If 'Use Plauti Assign' shows NOMATCH, no Match Group matched the record. Check the Match Log and the priority of your Match Groups.

Problem:

My Flow sends records back to Plauti Assign, but then Plauti Assign assigns my records twice.

Answer:

An After Save Flow, Apex code or other automation that runs after the save probably sets Use Plauti Assign to TRUE for records that this Flow already sent to assignment. Change it to a Before Save Flow as well, or only let the After Save Flow run when Use Plauti Assign is FALSE or empty.