3 Replies Latest reply: Jun 22, 2017 1:48 AM by Erik Wetterberg RSS

    Accessing QlikSense Extension properties from measure definition

    Darius Pranskus

      Hi Qlik Experts

       

      I am developing a QlikSense extention and would like to access it's property values from the measure definition. Is it possible? I am able to get the values in the same sesction, but how to do this from different section? Also would it be possible to get Qliks internal object id from the definition?

       

      Many thanks

       

      {
          type: "items",
          component: "accordion",
          items: {
              measures: {
                  uses: "measures",
                  min: 1,
                  items: {
                      customProperty: {
                          ref: "qDef.customProperty"; 
                          label: "Custom Measure Property",
                          type: "string",
                          defaultValue: function() {
                              // I would like to access extention object property "objectId" value defined in appearance/layout section
                              return "some initial value";
                          },
                          expression: "optional"
                      }
                  }
              },
              appearance: {
                  uses: "settings",
                  items: {
                      layout: {
                          type: "items",
                          label: "Layout",
                          items: {
                              objectId: {
                                  type: "string",
                                  label: "Object Id",
                                  ref: "qDef.objectId",
                                  defaultValue: function() {
                                      objectId = helpers.makeId(8); // use some helper function to generate a random id
                                      return objectId;
                                  },
                              }
                          }
                      }
                  }
              }
          }
      }