Qlik Community

Qlik Sense Integration, Extensions, & APIs

Discussion board where members can learn more about Integration, Extensions and API’s for Qlik Sense.

ikomlyakov1929
New Contributor III

Field API Select Method does not work on complex field

Hi everybody,

I've got the following code:

var test = app.field("=if(len(someField)>0,anotherField)").getData();

test.OnData.bind(function(){

     test.rows[0].select(true, true);

});

or another option:

app.field("=if(len(someField)>0,anotherField)").selectValues(["Some val from response"], true, true);

The problem is that getData() returns the right collection of values for this expression, but none of the select methods work.

Also those methods rise no exception or warnings.


Does anybody know what's wrong with my code or Field API?

Thanks

1 Solution

Accepted Solutions
erik_wetterberg
Honored Contributor

Re: Field API Select Method does not work on complex field

Hi,

That you can acutually do this is unintentional, app.field is only meant to work for actual fields (the parameter is supposed to be a field name), but since getData creates a ListObject it obviously works. Possibly a bug. You will need to keep track of what field to use for selections yourself, not too difficult in your example, but might be worse in the real case.

Erik Wetterberg

Erik Wetterberg
https://extendingqlik.upper88.com/
3 Replies
erik_wetterberg
Honored Contributor

Re: Field API Select Method does not work on complex field

Hi,

That you can acutually do this is unintentional, app.field is only meant to work for actual fields (the parameter is supposed to be a field name), but since getData creates a ListObject it obviously works. Possibly a bug. You will need to keep track of what field to use for selections yourself, not too difficult in your example, but might be worse in the real case.

Erik Wetterberg

Erik Wetterberg
https://extendingqlik.upper88.com/
ikomlyakov1929
New Contributor III

Re: Field API Select Method does not work on complex field

Hi Erik,

Actually, I decide to use Field API instead of serchResult because it gives me an ability to use a expression-like field for filtering in my extension. So this is a kind of situation when I can say that It's a feature - not a bug=)

Could you please give me an advice about the best way to do search and filtering like qlik sense have in their native table component?

QS SEARCH.JPG

Thanks

erik_wetterberg
Honored Contributor

Re: Field API Select Method does not work on complex field

Hi,

I don't really know how the built-in table works, but it looks like it opens a listbox when you click search in the header. You could do that with the visualization API.

Erik Wetterberg

Erik Wetterberg
https://extendingqlik.upper88.com/
Community Browser