Undeleting Records with Flow
Created by Yumi Ibrahimzade
You can perform insert, update and delete operations in Salesforce Flow. Most of the time, they are enough but what if you want to undelete records from the recycle bin? There isn’t undelete records operation in Flow. However, you can achieve this using this Invocable Apex Action.
See this post for the main discussion of this new Flow capability.
Production or Developer Edition
recordIds – Enter a text collection of record Ids to undelete.
This Invocable Apex Action undeletes the records from the Recycle Bin. If the record is permanently deleted, which means that it is not in the Recycle Bin anymore, you cannot undelete it.
HOW TO USE
Add an Action element from the Toolbox and search for FlowUndeleteRecords. Pass the text collection of the record Ids to the input parameter called recordIds. Even if you want to pass a single record Id, you still need to create a text collection and pass it as the input value.
Read this post to learn how to find the deleted record Ids and see an example of undeleting records using this Invocable Apex Action.