This article provides an overview of how to manage Space membership for users using Qlik Application Automation. This approach can be useful when migrating from QlikView, or Qlik Sense Client Managed, to Qlik Sense Cloud when security concerns prevent the usage of Qlik-CLI and PowerShell scripting.
You will find an automation attached to this article that works with the Microsoft Excel connector. More information on importing automations can be found here.
Content:
Prerequisites
- Access to a Qlik Cloud tenant
- User assigned the role of Tenant Admin
- Office 365 account (for Microsoft Excel)
Sheet configuration
In this example, we use Microsoft Excel to configure users' Space memberships. A sheet name, for example, Members, must be added and this must also be provided as input when running the automation. The sheet must also contain these headers: SpaceName, email, roles, and Flag.
Example of sheet configuration:
When adding roles, each role in the roles list must be within double quotes and the Flag column must be set to add. If users are to be deleted, there is no need to include roles, but Flag must be set to delete.
The spaces and users you supply must exist; this automation will not create them.
Automation Configuration
- Add an Input block that takes the name of the worksheet from which data should be read as input. You also need to specify the first and last cell to read data from, as well as if users are to be added or deleted.
- Add two variables of the type number. One to keep track of added users and one to keep track of deleted users. These variables will be used to update the run title when the automation has been completed. Observe that only one of them would be used when running the automation since only one of the run modes can be used (Add or Delete). Let's call the variables vUsersAddedCounter and vUsersDeletedCounter.
- Add a List Rows With Headers block to read the values that have been configured in the Excel sheet.
- Use the "do lookup" function to find the Drive Id and Item Id of the file you will be using as a source.
- Configure the other fields to get the values from the input fields.
- Inside the List Rows With Headers loop, add the Qlik Cloud Services block Search Spaces.
- Add a Condition block and check if the space exists and if we're in Add mode.
- If the conditions are true, use the Qlik Cloud Services block List Members From Space.
- Add the Qlik Cloud Services block Search Users.
- Add a second Condition block that checks if the user exists and is not a member of the space.
- If the conditions are true, use the Qlik Cloud Services block Add Member To Space.
- After the Add Member To Space block, add a variable block and increment vUsersAddedCounter with 1.
- If the first condition in the List Rows With Headers loop is false, then use a third Condition block to find out if we're in Delete mode and if the space exists.
- If the conditions are true, use the Qlik Cloud Services blocks List Members From Space.
- Add the Qlik Cloud Services block Search Users.
- Add a fourth Condition block that checks if the user is a member of the space.
- If the Condition is true, use the Qlik Cloud Services block Delete Member From Space.
- After the Delete Member From Space block add a variable block and increment vUsersDeletedCounter with 1.
- The last part of this automation is a fifth Condition block that checks the run mode and updates the automation's run title to display how many users have been added or deleted.
Running the Automation
When running the automation you must provide input to the automation. This includes the name of the worksheet to read data from. You also need to specify the first and last cell to read data from, as well as if users are to be added or deleted.
Example:
Input |
Value |
Worksheet Name
|
Members
|
Excel Start Cell
|
A1
|
Excel End Cell
|
D15
|
Mode
|
Add |
Considerations
- A multitenant scenario can be supported by utilizing the Qlik Platform Operations connector instead of the Qlik Cloud Services connector.
- Google Sheets could be used instead of Microsoft Excel.
The information in this article is provided as-is and to be used at own discretion. Depending on tool(s) used, customization(s), and/or other factors ongoing support on the solution below may not be provided by Qlik Support.