Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
hvdbunte
Partner - Contributor III
Partner - Contributor III

edit script load editor with .net SDK

Hi,

We started using the .net SDK in combination with the Qlik-Cli for Windows version for deploying apps to multiple streams.
For every stream we would like to change some variables in the Data load editor. Is that possible with the SDK? I found some options for changing the script with the engine JSON api but not with the SDK.

We have these 3 variables that we use to connect databases, we would like to change for every stream:

let CustomerName = 'CustomerA'
let DWH_CustomerName = 'DWH_CustomerA'
let Source_CustomerName = 'Source_CustomerA'

Would it be possible to search and replace these variable values in the load script?

Kind Regards

Labels (4)
15 Replies
michasiuk
Contributor III
Contributor III

@Marc 

Hi Mark I have bee working through your solution closely but am running into some websocket issues. The error that I keep getting with my code is the following.

Exception calling "GetAppIdentifiers" with "1" argument(s): "The WebSocket is in an invalid state ('Aborted') for this operation. Valid states are: 'Open, CloseReceived'"
At D:\QLIK\Development\PowerShell\LoadScriptAudit2.ps1:42 char:1
+ $AppIdentifiers = [Qlik.Engine.LocationExtensions]::GetAppIdentifiers($Location)
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : WebSocketException

I'm not sure what is causing it. I have gone through the QMC and made sure that the virtual proxy is enabled and white listed but I still keep getting the same error. I have put up a community post see link below but haven't managed to get a useful response to date. So I am still not sure what is causing the issue.

https://community.qlik.com/t5/Connectivity-Data-Prep/Web-sockets-connectivity-issue-net-SDK/m-p/1819...

michasiuk
Contributor III
Contributor III

Just a quick note I can get the Qlik-Cli to work successfully but I cannot get this to work successfully

hvdbunte
Partner - Contributor III
Partner - Contributor III
Author

@michasiukI am not sure if this is still helpful but we are using different code to connect to qlik sense:

 $uri = "wss://$($computerName):$($computerPort)"

 Write-Verbose "uri: $uri"
   $location = [Qlik.Engine.Location]::FromUri($uri)
[Qlik.Engine.LocationExtensions]::AsDirectConnection($location,$userDirectory,$userName)

        # get the app's appIdentifier 
	    $appIdentifier = [Qlik.Engine.LocationExtensions]::AppWithIdOrDefault($location, $id)

The $id variable is the app id.

Hope this helps.

michasiuk
Contributor III
Contributor III

Thanks I'll try this and see what happens. The only question that I would like to ask is what should the variable $id be set to in the line. 

$appIdentifier = [Qlik.Engine.LocationExtensions]::AppWithIdOrDefault($location, $id)

 

michasiuk
Contributor III
Contributor III

modified the script slightly changed the line:

$appIdentifier = [Qlik.Engine.LocationExtensions]::AppWithIdOrDefault($location, $id)

to 

$appIdentifier = [Qlik.Engine.LocationExtensions]::AppWithIdOrDefault($location)

But getting the following error: I suspect that it's a certificate error not sure how to use certificates in the connection.

Exception calling "GetAppIdentifiers" with "1" argument(s): "Value cannot be null.
Parameter name: certificates"
At D:\QlikNprinting\PowerShell\Script\TestConnect.ps1:25 char:1
+ $AppIdentifiers = [Qlik.Engine.LocationExtensions]::GetAppIdentifiers($Location) ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : ArgumentNullException