Skip to Content
avatar image
Former Member

Extracting Dimension Values from a Data Source

I wanted to create a control that would extract all of the dimensions from a data source, and then create a single string with comma separated values.

I started with the simple table sample and kept the following component:

<property id="column1" title="Column X" type="ResultCellList" group="DataBinding"> <option name="includeFormattedData" value="true"/> <option name="includeMetadata" value="true"/> </property>

I then modified the afterUpdate function to:

this.afterUpdate = function() {



         for(i=1; i < this.metadata().dimensions[1].members.length-1; i++){


               commaStr = this.metadata().dimensions[1].members[i].text;




               commaStr = tempStr + ', ' + this.metadata().dimensions[1].members[i].text;









This does give me the output that I want:

string_1, string_2, string_3, string_4, ...

My questions are:

  • Currently, I have to assign a data source through Data Binding: Data Source and Column 1, in the Design Studio interface.
    • I want to only assign the data source, since I am not showing the data selected in Column 1.
  • I am using ResultCellList, should I be using ResultSet? If so, then how would my code change?
  • Are there definitions somewhere that explains exactly how to use the ResultSet, ResultCellList, and others?
  • After assigning the Data Source, the AfterUpdate function gets called. What is passed to the AfterUpdate function? Is there a way to access the data source and its contents in this AfterUpdate call?



Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    Jan 05, 2015 at 08:50 AM

    Hi Robert,

    probably you already had a look into the developer guide but I would like to point you in particular to the pages 28 and 43 ff on the matter of using ResultSet or ResultCellList.

    When using ResultSet you can set the associated variable to "{}", which means all of the data will be send to your control. That way you don't need to set any columns. For convenience put a default value in your contribution.xml file.

    Changing your property's type from ResultSet to ResultCellList should be enough.

    Now on to your last question, I would suggest using your favorite browser's developer tools which you could access via F12 and to put a breakpoint near afterUpdate. In addition to that you could output your metadata json with console.log(JSON.stringify(<your var name>)) to learn its structure and content. I wouldn't recommend the alert function as the json can get quite lengthy.

    Hope this helps.



    Add comment
    10|10000 characters needed characters exceeded