Discussion board where members can learn more about Integration, Extensions and API’s for Qlik Sense.
Hi,
I've recently started to create Mashups using the Engine API. Can someone tell me how i select a value of a field in the Qlik sense app using the Engine API?
e.g. I have a field in my Qlik Sense App called CustomerID and i want to select where CustomerID = 1
Many thanks
Andy
Use GetField to get a field object, then there are some different methods:
Thanks for your reply Eric
I'm trying this but to no avail
app.getField('CustomerID ')
.then((result) => result.selectValues(10000067)
)
error :
JSON parse error
at Intercept.errorResponseInterceptor (error-response-interceptor.js:1
Do you know what i'm doing wrong?
Thanks
Andy
I am able to run the SelectValues after selecting a field in my app, and qReturn= true on response. However, the table objects in my App are not filtered at all. Are you able to explain how I can use this SelectValues method and then apply the field selections as a filter to an entire sheet or to a specific table object? Thank you.
Hi
After selectValues you need to get the result and then invoke a promise to reload your other objects. e.g.
let exampleVisualisationRender= new exampleVisualisation(exampleData)
...
object.selectValues( [
{qText: "1234", qIsNumeric: true, qNumber: 1234}
]).then((result) =>{
Promise.all([ExampleData.open()]).then(() => {
exampleVisualisationRender.init()
})})
Hope that helps
Andy
The first parameter should be an array.
Thanks, @andyjalexlive This reply helped a lot. For other newcomers like myself while I read the documentation I did not realize a couple of things that prevented the SelectValues method from actually being applied. Below are the points I (finally) figured out to solve this: