How do I get the initial value of a parameter in a javascript part

Tony Halse_22248
Tony Halse_22248 Altair Community Member
edited October 15 in Community Q&A

I can listen for parameter changes in the PostLink section of a javascript part using code like the snippet I've pasted below.

But I want to find the initial value of a parameter as well (ie the value on entry to the dashboard, before it is ever changed).

Is there a function I can call to retrieve this value?

 

config.handleParamChanged = function h(event) {
 var v = event.parameters.filter(function (param) {
  return param.name === 'maxrows';
 })[0];
 if (!v) {  return; };
  config.maxrows = v.value
};
PanopticonApi.addParameterListener(config.handleParamChanged);
function destroy() {
    PanopticonApi.removeParameterListener(config.handleParamChanged);
}
return destroy;

Answers

  • Mikael Konradsson
    Mikael Konradsson
    Altair Employee
    edited October 15

    Hi,

    Sorry for the late reply!

    Have a look at the function PanopticonApi.getCurrentWorkbook(). This function will return the current state of the workbook. 

    image

    With Regards

    Mikael