12-22-2022, 08:18 AM
Both setContext and Var use to assign value to a variable. But if we are using Var, we can not use the Variable outside the particular scripting area(Component/Connection). At the same time, setContext can be used anywhere in the Dashboard.
Ie, if we are setting a context in Dashboard script, we can utilize the assigned value in any other component or connection scripting area using getContext.
Eg:
sdk.setContext( 'age_val', 1 ); --> In dashboard Script
var a = sdk.getContext( 'age_val' ); -->In component Script
Ie, if we are setting a context in Dashboard script, we can utilize the assigned value in any other component or connection scripting area using getContext.
Eg:
sdk.setContext( 'age_val', 1 ); --> In dashboard Script
var a = sdk.getContext( 'age_val' ); -->In component Script