Skip to Content

Sap Analytic Cloud Application Design - How to fill a dropdown by data source dimension?

Hello,

does somebody know how to fill a dropdown within SAP Analytic Cloud Analytic Application

I understand that you have to fill it on onInitialization.

My try was:

var product_list = Table_1.getDataSource().getMembers("Produkt");

Dropdown_Produkt.addItem(product_list, product_list);

How is the syntax for

addItem(key: string, text?: string);

Thank you for your support

Best regards

Michael

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

2 Answers

  • Best Answer
    Apr 16 at 06:50 PM

    Michael - it is not active in my tenant yet, but here is the on init code we used in a workshop recently:

    var i=0;
    var ListDimensions = Table_1.getDataSource().getDimensions();
    for (i=0;i< ListDimensions.length; i++)
    {
    Dropdown_2.addItem(ListDimensions[i].id,ListDimensions[i].description);
    }
    

    Hope that helps.

    Add comment
    10|10000 characters needed characters exceeded

  • Apr 18 at 12:22 PM

    Hello Tammy thank you for your quick answer.

    The code you delivered was almost right I just changed

    var i=0;
    var productlist = Table_1.getDataSource().getMembers("Produkt");
    for (i=0;i< productlist.length; i++)
    {
    Dropdown_Produkt.addItem(productlist[i].id,productlist[i].description);
    }

    Thank you very much.

    Best regards

    Michael Wecker

    Add comment
    10|10000 characters needed characters exceeded