Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I'm relatively new to Qlik Sense and the world of mashups, but I haven't been able to find any similar questions on the community.
I'm currently building a mashup and I've created a List, used the callback function to fill a form with checkbox inputs, and added a submit button.
What I'm struggling with is getting SelectValues() to work with a string variable that combs the form for selections and puts them in the correct format.
$("#form-member-status .submit-button").click(function() {
let myForm = document.getElementById("form-member-status").querySelectorAll('input[type=checkbox]');
var selections = [];
for(var i=0; i<myForm.length; i++) {
if(myForm[i].checked) {
selections.push('"' + myForm[i].value + '"');
}
};
var selectionsString = '[{qText: ' + selections.join("},{qText: ") + '}]';
app.field("StatusOfMember").selectValues(selectionString, false, false);
});
For some reason this does not work. However, if I add in alert(seletionsString) and take that value and paste it in so I have the following, this works fine.
app.field("StatusOfMember").selectValues([{qText: "Member"},{qText: "Partner"}], false, false);
This shows the rest of the code is working correctly.
Any help would be much appreciated.