Salesforce Fact #919 | Remove selected UT2A records using screen action

In continuation of the last post related to screen action, we can extend the logic to remove a user from selected territories. The subflow returns the UserTerritory2Association records for the input userId and in the main flow, the result is shown in datatable allowing the user to select a record and then proceed with the deletion. Attached are the screenshots. Note: For demonstration purpose, used the Territory2Id field for storing the territory label but it is not advised to follow.