3 Replies Latest reply: Aug 13, 2018 11:10 AM by Anders Nielsen RSS

    Trouble with Capability API - selectValues

    Anders Nielsen

      I can't get thhe selectValues method to work.

       

      Using the example on https://help.qlik.com/en-US/sense-developer/June2018/Subsystems/APIs/Content/CapabilityAPIs/FieldAPI/selectValues-method…, I am trying to set field values using qText values.

       

      For example, I have a Weekday field that looks like this (from app1.field("Weekday").getData()):

      weekday.PNG

       

      I've tried selecting values by using:

      weekdayField.selectValues([{qText: "Thu"}], false, false);

      and

      weekdayField.selectValues(["Thu"], false, false);

      and

      weekdayField.selectValues(["Thu", "Fri"], true, true);

      but none of these work. They don't produce a JavaScript error, but they don't do anything.

       

      I am, however, able to select values by index using:

      weekdayField.select([1, 3], true, true); <-- works like a charm.

       

      What am I doing wrong since selectValues isn't working?