A frequent requirement that we receive is to change the owner of cases from a user that has become inactive. A simple flow can do the trick. In this blog I will go through the steps to set up a flow to change the owner of cases that are owned by inactive users.
The steps are included below:
- Create a new flow and select when you want to run the flow.
- In the "Object" field, select "Case".
- Add a “Decision Element”, add a filter to only get cases where the current owner is inactive. The filter condition should look like this:
- Create a new “Resource”, select “Variable” as Resource Type. In the “Data Type” field, select "Record" and in the “Object” field, select “User”.
- Add the “Get Records” element. In the “Object” field, select “User”. In the “Filter Records” section, add a filter to only get the Active Users. Alternatively a specific user can be added in the filter criteria.
- Sort the Records by “Id” in “Ascending” order. Store “Only the first record” in the Record Variable you created.
- Add “Update Records” element, Select “OwnerId” field. In the "Value" field, select the “Id” from the Record Variable, like the example as shown below:
- Save and activate the flow.
This flow will update all cases where the current owner is inactive and set the new owner to the user with the lowest ID who is active. You can customize the filter and formula to fit your specific business requirements.
A screenshot of the flow is given as a reference
Similar ideas can be applied to to change the owners of other objects.