Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have the following situation. We have a Qlik app and dashboard with one essential information we want in another system. We have middleware that can do nearly every protocol, but I couldn't find a "simple" way to request this information via REST call to Qlik. I also tried to set up a new REST data source inside the app and send the value as a POST body via a script, but I could not configure a timer inside Qlik to trigger this call.
Does anyone know a technique to get the data without doing web scraping? There is no problem with sending an HTTP call from the middleware to Qlik Sense every minute or using another protocol. I just don't know how to handle it in Qlik Sense.
That's how we display the required value inside the app (That's the value I need every minute):
let value = only({<StationType = {"*OUTPUT*"}, LineName={"Line1"}>} #ScrapSNSG);
I assume this value
only({<StationType = {"*OUTPUT*"}, LineName={"Line1"}>} #ScrapSNSG)
changes only when the Qlik App is reloaded? If so, why not store it in a file during reload and pick up that file from your middleware.
-Rob
You are right. Thanks a lot for this idea, this way it should also work with HTTP call.
Either way, I’m struggling with this right now. This works for the Dashboard, but not in the Script. How do I have to change it, to get the values? (I get an syntax error) (Yes, I see the typo in Line1)
Regarding the REST call, this is also not working, because of a syntax error.
Thx a lot 🙂
You can't use Set Analysis in script. You have to code the equivalent which would be a Load statement using Where and possibly Group By clauses. If all the necessary fields are in the same table, something like:
EssentialKPI:
LOAD #ScrapSNSG
Resident Mydata
Where StationType like '*OUTPUT*' and 'Line1';
// Store in file to be read by Middleware. Or skip this and POST from the script.
STORE EssentialKPI Into lib://someCloudDataConnection/EssentialKPI.csv (txt);
If the fields are not in the same "MyData" table, you may need to create some temporary association. See https://qlikviewcookbook.com/2020/03/creating-temporary-script-associations/ for suggestions.
Re your attempt at POSTing using the REST connector. Take a look at the doc for WITH CONNECTION here https://help.qlik.com/en-US/connectors/Subsystems/REST_connector_help/Content/Connectors_REST/Load-R... and search "Qlik Rest connector post" to see how others have done this. I believe the METHOD should be in the connection def and you should reference the conection with LIB CONNECT TO "Middleware REST connection".
-Rob
http://www.easyqlik.com
http://masterssummit.com
http://qlikviewcookbook.com