Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
BenjaminT
Partner - Creator
Partner - Creator

Get list of all Users' Usernames and Domains

In Qlik Cloud, I know we can use the "Get users" block in the Qlik Cloud Services connector to obtain a list of all user information. However it only shows the user's full name and email address, not their domain and username information from the identity provider.

Does anyone know how to get a list of domain/username for all users, either using Qlik Automation or from an app script?

Labels (1)
1 Solution

Accepted Solutions
Corona55
Creator
Creator

The Entitlement Analyzer app in cloud has the domains/users listed in the userSubject field. You could copy/paste the RestConnectorMasterTable in its own app script to get those values:

The code snippet:

RestConnectorMasterTable:
SQL SELECT
"__KEY_root",
(SELECT
"__KEY_links",
"__FK_links",
(SELECT
"href",
"__FK_self"
FROM "self" FK "__FK_self"),
(SELECT
"href" AS "href_u0",
"__FK_next"
FROM "next" FK "__FK_next")
FROM "links" PK "__KEY_links" FK "__FK_links"),
(SELECT
"id",
"tenantId",
"created",
"lastUpdated",
"status",
"name",
"subject",
"email",
"zoneinfo",
"locale",
"preferredLocale",
"__KEY_data",
"__FK_data",
(SELECT
"@Value",
"__FK_roles"
FROM "roles" FK "__FK_roles" ArrayValueAlias "@Value"),
(SELECT
"__KEY_links_u0",
"__FK_links_u0",
(SELECT
"href" AS "href_u1",
"__FK_self_u0"
FROM "self" FK "__FK_self_u0")
FROM "links" PK "__KEY_links_u0" FK "__FK_links_u0")
FROM "data" PK "__KEY_data" FK "__FK_data")
FROM JSON (wrap on) "root" PK "__KEY_root"
WITH CONNECTION (
URL "https://$(vu_tenant_fqdn)/api/v1/users?$(vParams)"
);

[Users]:
LOAD
trim([id]) AS userId,
[name],
[email],
Lower(subject) AS userSubject // have to do this as users and assigments API case varies on subject
RESIDENT RestConnectorMasterTable
WHERE NOT IsNull([__FK_data]);

View solution in original post

2 Replies
Corona55
Creator
Creator

The Entitlement Analyzer app in cloud has the domains/users listed in the userSubject field. You could copy/paste the RestConnectorMasterTable in its own app script to get those values:

The code snippet:

RestConnectorMasterTable:
SQL SELECT
"__KEY_root",
(SELECT
"__KEY_links",
"__FK_links",
(SELECT
"href",
"__FK_self"
FROM "self" FK "__FK_self"),
(SELECT
"href" AS "href_u0",
"__FK_next"
FROM "next" FK "__FK_next")
FROM "links" PK "__KEY_links" FK "__FK_links"),
(SELECT
"id",
"tenantId",
"created",
"lastUpdated",
"status",
"name",
"subject",
"email",
"zoneinfo",
"locale",
"preferredLocale",
"__KEY_data",
"__FK_data",
(SELECT
"@Value",
"__FK_roles"
FROM "roles" FK "__FK_roles" ArrayValueAlias "@Value"),
(SELECT
"__KEY_links_u0",
"__FK_links_u0",
(SELECT
"href" AS "href_u1",
"__FK_self_u0"
FROM "self" FK "__FK_self_u0")
FROM "links" PK "__KEY_links_u0" FK "__FK_links_u0")
FROM "data" PK "__KEY_data" FK "__FK_data")
FROM JSON (wrap on) "root" PK "__KEY_root"
WITH CONNECTION (
URL "https://$(vu_tenant_fqdn)/api/v1/users?$(vParams)"
);

[Users]:
LOAD
trim([id]) AS userId,
[name],
[email],
Lower(subject) AS userSubject // have to do this as users and assigments API case varies on subject
RESIDENT RestConnectorMasterTable
WHERE NOT IsNull([__FK_data]);

BenjaminT
Partner - Creator
Partner - Creator
Author

Brilliant, thanks @Corona55 !