Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Jcuenca1
Contributor
Contributor

Need to load a field from Pluralsight API in Qliksense

Hi,

I created a report to track the progress of the company training progress. It works and I am doing some updates to it now. I want to include the team name for each user. This is the documentation I am referring to: 

https://developer.pluralsight.com/schema/user/users

and the field 'teamNames' description states:

teamNames [String] A list of all the team names that the user is directly on.

 

so this is my query ( I removed the api key and any other confidential information) :

UsersTotalCount:
SQL SELECT
"__KEY_data",
(SELECT
"totalCount"
FROM "users" PK "__KEY_users" FK "__FK_users")
FROM JSON (wrap off) "data" PK "__KEY_data"
WITH CONNECTION (
QUERY "type" "JSON",
HTTPHEADER "Authorization" "KEY",
HTTPHEADER "Content-Type" "application/json",
BODY "{""query"":""query{ users { totalCount } }"" }"
);
 
LET totalCount = Peek('totalCount', 0, 'UsersTotalCount');
 
DROP TABLE UsersTotalCount;
 
RestConnectorMasterTable:
load 
__KEY_data as userData,
__KEY_users as userKey,
__FK_users as fk_User,
__FK_nodes as userNode,
id as userId,
email as userEmail,
firstName,
lastName,
teamNames;
SQL SELECT
"__KEY_data",
(SELECT
"__KEY_users",
"__FK_users",
(SELECT
"id",
"email",
"firstName",
"lastName",
"teamNames",
"__FK_nodes"
FROM "nodes" FK "__FK_nodes")
FROM "users" PK "__KEY_users" FK "__FK_users")
FROM JSON (wrap off) "data" PK "__KEY_data"
WITH CONNECTION (
QUERY "type" "JSON",
HTTPHEADER "Authorization" "KEY",
HTTPHEADER "Content-Type" "application/json",
BODY "{""query"":""query{ users (first: $(totalCount) filter:{isCurrent: true}){nodes {id email firstName lastName teamNames }}}""}"
);
 
 
[users]:
LOAD
[userId],
lower([userEmail]) as [userEmail],
[firstName],
[lastName],
    [firstName] & ' ' & [lastName] as [Full Name],
    [teamNames],
[userNode]
    
 
RESIDENT RestConnectorMasterTable

 

 

All the fields are populated and correct however, the teamNames field is just blank for every user.

Im guessing that since teamNames is an array, thats where the issue lies but I dont know what to do. Any assistance is greatly appreciated, Thanks!

Labels (4)
0 Replies