Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
jgunders
Contributor II
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
ErikWetterberg
Master
Master

Try with [] since the field name contains spaces:

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

View solution in original post

jgunders
Contributor II
Contributor II
Author

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
Specialist III
Specialist III

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
Contributor II
Contributor II
Author

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!

 

ErikWetterberg
Master
Master

Try with [] since the field name contains spaces:

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

jgunders
Contributor II
Contributor II
Author

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.