How to have Discovery type parameter displayed as Tree Menu when Advanced Mode is enabled in Custom

Hua
Hua Member

I am able to have configuration code for dropdown, but so far can't seem to make it happen for Tree Menu.  Please send some sample code and improve documentation.

 

Thanks.

Comments

  • GTA
    GTA Domo Employee

    Can you let me know which connector that you are referring to? We can definitely get this looked at. Thanks

  • Hua
    Hua Member

    I'm writing my own custom connector.  Please see attachement.

     

     

  • GTA
    GTA Domo Employee

    I will send this over to our team to see if there is sample code that we can provide. Stay tuned. Thanks

  • DarrelR
    DarrelR Domo Employee

     Hua,

     

    Please see attached.

     

    Of note, please notice the publisTree() command at the end.

     

        

    var res = JSON.parse(httprequest.get(baseURL+'all'));
    var regions = {};
    for(var i in res){
    var country = res[i];
    if(!country.region){
    country.region = "other"
    }

    if(!regions[country.region]){
    var node = discovery.addNode(discovery.tree,country.region)
    regions[country.region] = node;
    }
    discovery.addLeaf(regions[country.region],country.name)
    }
    discovery.publishTree();