Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello
I'm building an extension in which settings I need to insert xrfkey to communicate with the server. My problem is that I would like to generate a dropdown list with reload tasks but to do that I need to send a request to that server containing that xrfkey previously entered by user. How can I achieve building that list dynamically based on provided parameters instead of hardcoding it as in below file with properties panel code? Also attached screenshot of I would like to achieve dynamically
define([], function () { 'use strict' return { type: "items", component: "accordion", items: { extensionSettings: { type: "items", label: "Extension Settings", items: { xrfkey: { ref: "props.xrfkey", label: "Qlik Sense Xrfkey", type: "string" }, tasksDropdown: { type: "string", component: "dropdown", label: "Task", ref: "props.taskId", options: function () { return $.ajax({ type: "GET", url: "https://serveraddress/hdr/qrs/task/full?Xrfkey=abcdefghijklmnop", headers: { "X-Qlik-Xrfkey": "abcdefghijklmnop", "hdr-usr": "domain\\username" } }).then(function (response) { return response.map(function (item) { return { value: item.id, label: item.name } }) }) }, defaultValue: "" } } } } } })
Try callRepository in capabilities API. It Will generade the xrfKey for you.