Qlik Community

Qlik Sense Integration, Extensions, & APIs

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

Announcements
BARC’s The BI Survey 19 makes it official. BI users love Qlik. GET REPORT
jgunders
New Contributor II

Trouble with capability API - field selectValues

Trying to set up a mashup with two apps and shared filters.  There is a listener on the selectionState of the first app like this:

Untitled.png

which sets the field selectValues of the second app.  This works for some fields but not all.  I looked at one of the problem fields using

app.field('METRIC DATE.YEAR').getData();

compared to:

app1.field('METRIC DATE.YEAR').getData();

and it is identical in both apps.  I also tried setting it directly as numeric and text:

app1.field('METRIC DATE.YEAR').selectValues([2016], true, true);

app1.field('METRIC DATE.YEAR').selectValues(['2016'], true, true);

but no luck.

Any ideas on what to try next?

 

 

2 Solutions

Accepted Solutions
Highlighted
ErikWetterberg
Honored Contributor

Re: Trouble with capability API - field selectValues

Try with [] since the field name contains spaces:

app1.field(‘[METRIC DATE.YEAR]’)...

View solution in original post

jgunders
New Contributor II

Re: Trouble with capability API - field selectValues

Thanks for the help with this @ErikWetterberg and @agni_gold .  Turns out it is a problem of text verses numeric.   Looks like all the selections from selectionState are text but my selections can be text and numeric ☹️.  I'm going to force all my shared dimensions to be text.

View solution in original post

4 Replies
agni_gold
Valued Contributor III

Re: Trouble with capability API - field selectValues

have you tried like below

app1.field('METRIC DATE.YEAR').selectValues(2016, true, true);

or have you tried with
selectMatch method ? , is this working ?

or you can provide your js code , may be i can help
jgunders
New Contributor II

Re: Trouble with capability API - field selectValues

I tried:

app1.field('METRIC DATE.YEAR').selectValues(2016, true, true);

but it throws:

e.forEach is not a function

I attached the source.  Thanks!

 

Highlighted
ErikWetterberg
Honored Contributor

Re: Trouble with capability API - field selectValues

Try with [] since the field name contains spaces:

app1.field(‘[METRIC DATE.YEAR]’)...

View solution in original post

jgunders
New Contributor II

Re: Trouble with capability API - field selectValues

Thanks for the help with this @ErikWetterberg and @agni_gold .  Turns out it is a problem of text verses numeric.   Looks like all the selections from selectionState are text but my selections can be text and numeric ☹️.  I'm going to force all my shared dimensions to be text.

View solution in original post