Bulk-Unassign a Health Cloud Permission Set or License
To unassign a permission set and permission set license for multiple users, you'll
need the users' internal IDs, the ID of the permission set, and the ID of the permission set
license.
|
Available in: Lightning Experience Available in: Enterprise and Unlimited Editions with Health Cloud or Health Cloud for Life Sciences |
- In Data Loader, from the Export tab, log in and grant access to the company org.
- Click Show all Salesforce objects, and select the User object.
- Enter a unique name for the new CSV file (such as User_Extract.csv), and browse to where you want to download the generated file. Click Next.
- Select Id, LastName, and FirstName.
- Click Finish, then click Yes.
- Confirm that the downloaded file has three columns: the user’s unique ID, last name, and first name.
-
Back in the Data Loader Export tab, get the permission set ID.
- Click Show all Salesforce objects and select Permission Set.
- Give the target a unique file name (for example PermSet_extract.csv) and click Next.
-
In the panel of query fields, enter the following explicit query into
the text box, replacing
<Permission_Set_APIName> with the
appropriate permission set API name: Select Id, Name, Label
FROM PermissionSet WHERE Name =
‘<Permission_Set_APIName>’.
For example, the permission set API Name for the Health Cloud Permission Set License permission set is HealthCloudPermissionSetLicense and the API Name for the Health Cloud Starter permission set is HealthCloudStarter. You can find the permission set API name in Setup by searching for Permission Sets, then clicking the Permission Set Label to view details.
- Click Finish, then Yes to confirm and start the export.
A single record is created. - Open the downloaded file and copy the ID for the Health Cloud permission set.
-
Back in the Data Loader Export tab, get the unique internal Id for the
permission set license.
- Click Show all Salesforce objects and select Permission Set License.
- GIve the target a unique file name (such as PermSetLicense_extract.csv) and click Next.
-
In the panel of query fields, enter this SQL query, replacing
<Permission_Set_APIName> with the
appropriate permission set API name: Select Id,
DeveloperName, MasterLabel FROM PermissionSetLicense WHERE
MasterLabel = ‘<Permission_Set_APIName>’. Click
Finish and then
Yes.
This query creates a single record.
- In the downloaded file, copy the ID for the Health Cloud permission set license.
-
Create a list of users currently assigned to the permission set by querying for
the permission set ID.
- In the Data Loader Export tab, click Show all Salesforce objects and select Permission Set Assignment.
- Give the target a unique file name (such as PermSetAssignment_extract.csv) and click Next.
-
In the panel of query fields, enter this SQL query : Select
Id, PermissionSetId, AssigneeId FROM PermissionSetAssignment WHERE
PermissionSetId = ‘YOUR_UNIQUE_PERMSET_ID’.
Use your permission set Id in place of YOUR_UNIQUE_PERMSET_ID .
- Click Finish and then Yes to confirm and start the export.
-
Open the downloaded CSV file and identify which user IDs you want to unassign
the permission set. Delete all the rows from the permission set assignment file
for those users you want to keep the permission set.
The file should only contain rows of assigned users you want to unassign from the Health Cloud permission set.
-
Back in Data Loader, click the Delete tab.
- Click Show all Salesforce objects and select Permission Set Assignment.
- Choose your prepared permission set assignment CSV file (PermSetAssignment_extract.csv) and click Next.
- Click OK to verify the correct number of rows to be deleted.
-
The next panel shows the three fields in the CSV file, and asks you to
select the CSV fields to be mapped. Click Create
Map, and in the next panel select Auto-Match
Fields to Columns. The ID field is mapped to Id. Click
OK, then Next.
You can save this mapping for use in future bulk unassigns.
- Specify where you would like to save the success and error files, then click Finish, then Yes.
- Confirm the Recycle Bin information, and click Yes to start the job.
- Verify that the users have been unassigned from the Health Cloud permission set.
-
Create the list of users currently assigned to the permission set license by
querying for the permission set license ID. Return to the Data Loader and Export
tab.
- Click Show all Salesforce objects and select Permission Set License Assignment. Give the target a unique file name (for example, PermSetLicenseAssignment_extract.csv) and click Next.
- In the panel of query fields, enter this query into the text box: Select Id, PermissionSetLicenseId, AssigneeId FROM PermissionSetLicenseAssign WHERE PermissionSetLicenseId = ‘YOUR_UNIQUE_PERMSET_LICENSE_ID’. Enter permission set license ID you got in place of YOUR_UNIQUE_PERMSET_LICENSE_ID in the query string.
- Click Finish and then Yes to confirm and start the export.
-
In the downloaded CSV file, identify which user Ids you want to unassign from
the permission set license. Delete all the rows for any users you want to keep
the permission set license.
- Back in Data Loader, click Delete, then click Show all Salesforce objects and select Permission Set License Assignment. Choose your prepared permission set license assignment file (PermSetLicenseAssignment_extract.csv) and click Next.
- Verify that the number of rows to be deleted is correct and click OK.
-
To select the CSV fields to be mapped, click Create
Map, and in the next panel select Auto-Match
Fields to Columns. Click OK, then
Next.
You can save this mapping to use in future bulk unassigns.The ID field is mapped to Id.
- Specify where to save the success and error files, then click Finish, then Yes to proceed.
- In the pop-up warning about the Recycle Bin, click Yes to start the job.
- Verify that the correct number of licenses have been recovered. Go to Company Profile | Company Information, click Permission Set Licenses, and check the number of licenses for the Health Cloud permission set.