Helper Connector

The QlikHelper Connector is an internal helper connector, that is, it does not make outgoing calls to APIs. The QlikHelper Connector is run from within your QlikView or Qlik Sense applications.

Tip:

The Qlik Web Connectors help you connect to different data sources and fetch data in the same way. Learn how to authenticate a data source connection and how to use tables to fetch data.

Connecting to data sources

Using the connector

The QlikHelper Connector has the following tables available:

  • Encrypt - Encrypts a string using the internal algorithm used by other connectors. This can be used with connectors which take an encrypted password as an input parameter.

  • RequestInfo - Allows you to check the IP address of the URL to which a request is being made by your application. This can be used to retrieve an IP address to add to the white list in Qlik Web Connectors.

  • EchoParameters - This table echoes back any query string parameters to show how they are being received by Qlik Web Connectors.

  • HTMLDecodeFile - Some services may return angle brackets written as < and >, for example, XML. This table converts these back and provides a raw response which you can use to load the data into your application. You can use this after first running the SaveToDisk table in the General Web Connector.

  • ReplaceTokensInFile - Takes a file and replaces any tokens, for example, {name} or {id}, with the values supplied and writes a new file.

    Note: Although only one token replacement is shown in the UI, you can add as many as you like in the request URL. These should be in the format ...&token_name1=value1&token_name2=value2, and so on.

ReplaceTokensInFile table example

The ReplaceTokensInFile table is useful in the General Web Connector. For example, you can create a template file containing the data to be HTTP posted to a web service:

C:\QlikWebConnectors\Temp\Template.xml

containing:

<data>
<name>{name}</name>
<id>{id}<id>
</data>
 

If you make the following request:

HelperConnector_ReplaceTokensInFile:
LOAD
Status as ReplaceTokensInFile_Status,
TokensReplaced as ReplaceTokensInFile_TokensReplaced,
TokensReplacedCount as ReplaceTokensInFile_TokensReplacedCount
FROM
[http://localhost:5555/web/connector/HelperConnector/?table=ReplaceTokensInFile&filePath=C%3a%5cQVSource%5cTemp%5cTemplate.xml&fileTarget=C%3a%5cQVSource%5cTemp%5cInput1.xml&token_name=test&token_id=123]
(qvx);
 

the result is the creation of:

C:\QlikWebConnectors\Temp\Input1.xml

containing:

<data>
<name>test</name>
<id>123<id>
</data>
 

You can then use the following as the value of the POST parameter on the General Web Connector:

@file=c:\QVSource\Temp\Input1.xml

Alternatively, you can specify the replacements in a separate CSV file rather than in the URL. Instead of adding the values to the URL you could first use the following command:

Replacements:
LOAD * INLINE [
TokenName, TokenValue
name, test
id, 123
];
 
store * from Replacements into ReplaceTokensInFile.txt (txt);
 

Which creates the following text file:

TokenName, TokenValue
name, test
id, 123
 

Then you can run the following:

HelperConnector_ReplaceTokensInFile:
LOAD
Status as ReplaceTokensInFile_Status,
TokensReplaced as ReplaceTokensInFile_TokensReplaced,
TokensReplacedCount as ReplaceTokensInFile_TokensReplacedCount
FROM
[http://localhost:5555/web/connector/HelperConnector/?table=ReplaceTokensInFile&filePath=C%3a%5cQVSource%5cTemp%5cTemplate.xml&fileTarget=C%3a%5cQVSource%5cTemp%5cInput1.xml&fileTokens=C%3a%5cQVSource%5cTemp%5cReplaceTokensInFile.txt]
(qvx);
 

This last technique, using a CSV file of replacements, is particularly useful if you need to replace tokens with, for example, Chinese or Japanese text, since if these values are not properly encoded they can be lost when placed in the URL.

Did this information help you?

Can you tell us why it did not help you and how we can improve it?