Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
ikomlyakov1929
Partner - Contributor III
Partner - 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
ErikWetterberg

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

View solution in original post

3 Replies
ErikWetterberg

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

ikomlyakov1929
Partner - Contributor III
Partner - Contributor III
Author

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

ErikWetterberg

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