Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
warfollowmy_ver
Creator III
Creator III

How to get the value of a property in an extension from a function to the main code?

var MyObj = {MyVar:0};

var CurrentDocument = Qv.GetCurrentDocument();

CurrentDocument.GetAllVariables(function (vars) {
    for (var i = 0; i < vars.length; i++) {
         if (vars[i].name === "MyVariable") {
              MyObj .MyVar= vars[i].value;
         break;
         };
    };

    alert(MyObj .MyVar); //Work

};

   alert(MyObj .MyVar); //Undifined

 

Option with definition  below do not offer.  Firstly, it does not work in document extension. Secondly, when changing the xml, you need to delete and recreate the extension in the document each time. It came up with an idiot.

Definition.xml:

<Text Label="Text0" Type="text" Expression="=MyVariable"/>

P.S. This forum thread consists of corpses and no one can answer the sipmle questions that are asked?

 

Labels (1)
1 Reply
Sue_Macaluso
Community Manager
Community Manager

@warfollowmy_ver Hi there, thanks for participating in the community.  We are reaching out to someone for help, I hope they will be able to get the post soon.  Thanks for your patience. 

Did you find a solution to your question? Mark the solution as accepted : and if you found it useful, press the like button!