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

Announcements
Discover how organizations are unlocking new revenue streams: Watch here
cancel
Showing results for 
Search instead for 
Did you mean: 
lucpechali
Partner - Contributor III
Partner - Contributor III

HttpGet into Script

Hello,

I use this macro to get the information I need in a variable. It works prefectly. But now, I want to make a loop into script to get the response into a field . How can I achieve this ?

function httpGet

  Set val=ActiveDocument.Fields("Url").GetPossibleValues

  sStockID = val.Item(0).Text

  vURL = sStockID

  'Create xmlhttp opject

  Set xmlhttp = CreateObject("Microsoft.XMLHTTP")

  xmlhttp.open "GET", vURL, false

    xmlhttp.setRequestHeader "Content-Type", "text/xml"

  xmlhttp.send ""

  result = xmlhttp.responseText

  result = replace(result, ">", ">")

  result = replace(result, "&lt;", "<")

  set txt = ActiveDocument.Variables("vXMLReceived")

  txt.setContent result, true

end function

Thks for your help.

1 Solution

Accepted Solutions
petter
Partner - Champion III
Partner - Champion III

What you could do in the load script as a replacement for your VBScript you have is:

LOAD

     result

FROM [ http : // someurl ? abc=123 & def=456 ] (XmlSimple, Table is [string]);

Is that QlikView is in fact doing an HTTP GET. And what you specify as (XmlSimple ....   )

is that the return will be an XML-file. You could do similar Replace() functions in your load script to pull out the data you want.

The interactivity will not be directly possible - but what you could do is write the values to a server-side text-file or Excel-file and read that in before the load from HTTP and make variables that you will use as $-expansion in the final load.

View solution in original post

3 Replies
petter
Partner - Champion III
Partner - Champion III

What you could do in the load script as a replacement for your VBScript you have is:

LOAD

     result

FROM [ http : // someurl ? abc=123 & def=456 ] (XmlSimple, Table is [string]);

Is that QlikView is in fact doing an HTTP GET. And what you specify as (XmlSimple ....   )

is that the return will be an XML-file. You could do similar Replace() functions in your load script to pull out the data you want.

The interactivity will not be directly possible - but what you could do is write the values to a server-side text-file or Excel-file and read that in before the load from HTTP and make variables that you will use as $-expansion in the final load.

hectorgarcia
Partner - Creator III
Partner - Creator III

have you checked wget?  i use it and it works very well

lucpechali
Partner - Contributor III
Partner - Contributor III
Author

Thank you but I decided to use the load from web file in a loop.

Here is what I did  : https://community.qlik.com/docs/DOC-8955#comment-35868