Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!

Using Qlik Application Automation to add users into spaces

100% helpful (1/1)
cancel
Showing results for 
Search instead for 
Did you mean: 
Edy_Tan
Employee
Employee

Using Qlik Application Automation to add users into spaces

Last Update:

Nov 3, 2022 2:11:44 AM

Updated By:

Edy_Tan

Created date:

Mar 8, 2022 9:12:53 PM

During a workshop, the most tedious part is to assign a QlikCloud user into the workshop space.  With Qlik Application Automation , this process can be automated from the creation of the space to the assignment of the user into the specific space.

First, I created a google sheet that contains the list of users email, and 1 sheet correspond to 1 workshop.

Edy_Tan_8-1645684631968.png

I used the List Sheets Of Spreadsheet block to list out all the sheets within this workbook

Edy_Tan_0-1645683722535.png

Then I used the Condition block to check whether the sheet is prefix with *.  This provide a mechanism to skip any sheet by renaming the sheet.

Edy_Tan_1-1645683877592.png

If it is not prefix with *, the Create Space block will create a space for each sheet using the name of the sheet.  You will need to set the type of share and most importantly, set on error to ignore and continue automation and ignore errors.  This will ignore this block when the space has already been created.

Edy_Tan_2-1645683955849.png

Once the space is created, the Search Spaces block is used to retrieve the ID of the space as the space assignment is by the ID

Edy_Tan_3-1645684138700.png

Next, the Get Data From Sheet With Headers block is used to retrieve the list of users email from the google sheet

Edy_Tan_5-1645684277015.png

For each user email, the Search Users block is used to retrieve the ID based on the email address.

Edy_Tan_4-1645684262183.png

With both the Space ID and User ID, the Add Member To Space block is used to assign the user into the space.  Note the type of roles to assign to the user and the type of member.  Also set the on error to ignore and continue automation and ignore errors in case the user has not signed up yet.  This will ignore this user and move to the next user.

Edy_Tan_6-1645684400145.png

 

The following is the entire flow of the Qlik Application Automation

Edy_Tan_7-1645684527069.png

This can then be scheduled to run everyday and possibly more frequently just before the start of the workshop.

Edy_Tan_0-1645684954191.png

 

Labels (1)
Comments
msan
Partner - Contributor III
Partner - Contributor III

Would you know why the Add member to space fails in my case? I inputted a correct userid.
The error message doesn't tell much.add to space error.png

Edy_Tan
Employee
Employee

under the add member to space block the information required are:

Space Id - make sure you reference the space ID, I used Search Spaces to search the space name to return the Item>Id

Assignee Id - make sure you reference the user ID, I used Search Users block to search the user email address to return the Item>Id

Roles - the roles can be from managed spaces or shared spaces, for e.g. for shared spaces I used, ["producer","consumer","dataconsumer"]

Another possibility is the user might already been assigned to the space, either check before assigning or under settings set on error to ignore and continue automation

msan
Partner - Contributor III
Partner - Contributor III

Thanks, will check the last 🙂

0 Likes
KWF_JKassing
Contributor III
Contributor III

Thank you so much Edy!

0 Likes
jackm75
Creator
Creator

Thanks, @Edy_Tan ! How would I go about checking to see if a user is already assigned to a space? 

0 Likes
Edy_Tan
Employee
Employee

@jackm75  what I did is when I add the user to the space, under settings set on error to ignore and continue automation.

mar1opl
Partner - Contributor II
Partner - Contributor II

Great job @Edy_Tan 🙂
Did you invite new users from the Qlik Application  Automation? Is there such a possibility?

0 Likes
Edy_Tan
Employee
Employee

@mar1opl I am not able to locate the invite new user block or equivalent API.  If there is then we can create another automation to loop through the list to invite, and once they joined then assign them to the correct spaces

0 Likes
marcos_herrera
Partner - Creator III
Partner - Creator III

HI Dear @Edy_Tan 

Can you provide me the search synax used on Search Users block

 

Thanks

0 Likes
Edy_Tan
Employee
Employee

@marcos_herrera the search syntax I used is email co "john.doe@mail.com".  Co means contain.  There are others examples here. For more syntax you can refer to page 17 here.

 

 

0 Likes
Contributors
Version history
Last update:
‎2022-11-03 02:11 AM
Updated by: