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

Announcements
Independent validation for trusted, AI-ready data integration. See why IDC named Qlik a Leader: Read the Excerpt!
cancel
Showing results for 
Search instead for 
Did you mean: 
ArunQlIK9
Contributor
Contributor

Create a Qlikview Task using QMSAPI

Is there a method without using C#  and directly use QMSAPI and create a Qlikview Task.

something like this: 

$hdrs = @{}
$hdrs.Add("SOAPACTION","http://ws.qliktech.com/QMS/12/2/IQMS2/GetServices")
$hdrs.Add("Content-Type", "text/xml;charset=utf-8")
$hdrs.Add('X-Service-Key',$serviceKey)

$body = @{}
$body = '<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body>
<GetServices xmlns="http://ws.qliktech.com/QMS/12/2/">
<serviceTypes>All</serviceTypes>
</GetServices>
</s:Body>
</s:Envelope>'

$res = Invoke-WebRequest -Uri $url -Method Post -Body $body -UseDefaultCredential -Headers $hdrs

#Display result
$res.Content
Labels (1)
  • API

3 Replies
Marc
Employee
Employee

The QlikView-CLI will allow you to do that in PowerShell. (Install-Module QlikView-CLI)

 

# This script connects to QlikView, retrieves source documents, allows the user to select documents,
# and creates new document tasks for the selected documents with a general and reload task.

$Connection = Connect-QlikView # Establishes a connection to the QlikView server

$SourceDocuments = Get-QVSourceDocuments # Retrieves a list of source documents from the QlikView server

$SelectedDocuments = $SourceDocuments | Out-GridView -OutputMode Multiple -Title "Select Documents to create task for:" # Displays a grid view for the user to select multiple documents

foreach ($Document in $SelectedDocuments) { # Iterates over each selected document
    
    $TaskDescription = "Task for $($Document.Name), Created $([datetime]::Now.ToString('yyyy-MM-dd HH:mm:ss'))" # Creates a task description with the document name and current timestamp
    $TaskName = "Task-$($Document.Name)" # Creates a task name based on the document name

    $NewTaskGeneral = New-QVTaskGeneral -Enabled $true -Taskdescription $TaskDescription -Taskname $TaskName # Creates a new general task with the specified description and name

    $NewTaskReload = New-QVTaskReload -Mode Full -Sectionaccessmode UseQDSAccount # Creates a new reload task with full mode and section access mode set to use QDS account

    $NewDocumentTask = New-QVDocumentTask -Document $Document -General $NewTaskGeneral -Reload $NewTaskReload -QDSID $Connection.QlikViewDistributionService[0].ID -Scope @([QlikView_CLI.QMSAPI.DocumentTaskScope]::General, [QlikView_CLI.QMSAPI.DocumentTaskScope]::Reload) # Creates a new document task with the specified document, general task, reload task, QDS ID, and scope
    
    Save-QVDocumentTask -Documenttask $NewDocumentTask # Saves the newly created document task
}

 

ArunQlIK9
Contributor
Contributor
Author

Thanks for the reply Mark. Is this Qlikview-CLI is paid software we need to download or it will be there by default in Qlik Server?

Marc
Employee
Employee

It was created by Qlik Professional Services and released as open-source under the MIT license.

This is not an official Qlik product and is not covered by Qlik Support. However, paid support is available through a Professional Services engagement.