Welcome Guest, you are in: Login

QVSource: The QlikView & Qlik Sense API Connector (Docs)

QVSource does not currently have a dedicated QlikView/Qlik Sense Connector for Asana, however, as the Asana API (at time of writing) uses basic authentication the General Web Connector can be easily used to connect to this API.

NOTE: You will need version 1.3.2.5 of QVSource or later to run this script. This is because the Asana docs specify a maximum of 100 requests per minute so we need to use the minimumTimeBetweenRequests parameter which was made available in this version.

The following sample load script shows how to load all the tasks you have access to. By consulting the Asana API documentation you should be able to load all the data you need into QlikView or Qlik Sense.

Note that you will need to enter your own Asana API key for this to work.


let asanaAPIKey = '[ENTER YOUR API KEY]';

Projects:
LOAD
	id as Projects_id,
	name as Projects_name
FROM
[http://localhost:5555/QVSource/WebConnectorV2/?table=JsonToTable&verb=get&xpath=DATA%2fdata&UserName=$(asanaAPIKey)&url=https%3a%2f%2fapp.asana.com%2fapi%2f1.0%2fprojects&minimumTimeBetweenRequests=600&format=qvx]
(qvx);

LET noRows = NoOfRows('Projects');
   
for i=0 to $(noRows)-1

	let projectId = peek('Projects_id', $(i), 'Projects');

	set errormode = 0;
		
	TaskIds:
	LOAD
		'$(projectId)' as Projects_id,
		id as TaskIds_id,
		name as TaskIds_name
	FROM
	[http://localhost:5555/QVSource/WebConnectorV2/?table=JsonToTable&verb=get&xpath=DATA%2fdata&UserName$(asanaAPIKey)&url=https%3a%2f%2fapp.asana.com%2fapi%2f1.0%2ftasks%3fproject%3d$(projectId)&minimumTimeBetweenRequests=600&format=qvx]
	(qvx);

	set errormode = 1;
	
next

LET noRows = NoOfRows('TaskIds');

for i=0 to $(noRows)-1

	let taskId = peek('TaskIds_id', $(i), 'TaskIds');
	
	Tasks:
	LOAD
		id as TaskIds_id,
		workspace_id as Task_workspace_id,
		workspace_name as Task_workspace_name,
		created_at as Task_created_at,
		modified_at as Task_modified_at,
		name as Task_name,
		notes as Task_notes,
		completed as Task_completed,
		assignee_status as Task_assignee_status,
		due_on as Task_due_on,
		completed_at as Task_completed_at,
		followers_id as Task_followers_id,
		followers_name as Task_followers_name,
		date#(SubField(created_at, 'T', 1), 'YYYY-MM-DD') as global_date,
		// assignee as Task_assignee, doesn't seem to always exist
		projects_id as Task_projects_id,
		projects_name as Task_projects_name
	FROM
	[http://localhost:5555/QVSource/WebConnectorV2/?&cacheTimeInHours=6&table=JsonToTable&verb=get&xpath=DATA%2fdata&UserName=$(asanaAPIKey)&url=https%3a%2f%2fapp.asana.com%2fapi%2f1.0%2ftasks%2f$(taskId)&minimumTimeBetweenRequests=600&format=qvx]
	(qvx);

next

drop Table Projects;
drop table TaskIds;


(QVSource works with Qlik Sense as well as QlikView - See this page for notes.)
QVSource - The QlikView & Qlik Sense API Connector | © Copyright 2011 - 2016 Industrial CodeBox Ltd