This repository contains a Code Engine function and Workflow that allows Domo administrators to bulk update the ownership of all objects owned by a specific user to a new owner, and then delete the original user from the Domo instance.
There are deployed examples of this Code Engine package and Workflow in the Domo Community instance:
- Copy the code from
main.jsinto a new Code Engine package in your Domo instance. - Configure the two DataSet ID variables at the top of the code for the log and scheduled reports:
- Log DataSet: Can just be a webform DataSet, with the following columns (in order):
userId,newOwnerId,type,id,date,status,notes. - Scheduled Reports DataSet: This is the DomoStats Scheduled Reports DataSet that contains the list of scheduled reports in your instance. There isn't a good API endpoint to get this information, so we use this DataSet as a source of truth.
- Log DataSet: Can just be a webform DataSet, with the following columns (in order):
- Deploy the Code Engine package.
- Create a Workflow using the deployed Code Engine package and a trigger of your choice. You can use the Workflow definition in the community instance as reference.
- The Code Engine function transferContent requires two input parameters:
userId: The user ID of the user whose objects you want to reassign and who you want to delete.newOwnerId: The user ID of the user who will become the new owner of the objects.
- If you used the example Workflow from the community instance, update the email step as desired.
- Save and deploy the Workflow.
The function currently supports the following Domo object types for ownership reassignment:
- Accounts
- AI Models
- AI Projects
- Alerts
- App Studio Apps
- AppDB Collections
- Approval Templates
- Cards
- Code Engine Packages
- Custom Apps
- DataFlows
- DataSets
- Domo Everywhere Subscriptions
- FileSets
- Functions (Beast Modes and Variables)
- Goals
- Groups
- Jupyter Workspaces
- Metrics (Automated Insights)
- Pages
- Pending Approvals
- Projects and Tasks
- Sandbox Repositories
- Scheduled Reports (using DomoStats DataSet)
- Task Center Queues
- Task Center Tasks
- Workflows
- Domo Everywhere Publications (still gets logged but not reassigned)
- Sent Back Approvals (still gets logged but not reassigned)