I'm new here

How Read the Overridden Variable in Site Store

Dear All,

Is there any way to read the Overridden variable in site store's variable tab ??

Please find the below code which is working for the Declared Variable in Site Store.

reference.getReferencedObject().getParent().getData ().get("ss_XXXXX");

Thank You,


Labels (1)
1 Reply
Crownpeak employee
Crownpeak employee

Re: How Read the Overridden Variable in Site Store


I'm not sure if I really understand your problem.

Let's assume we have a variable structure like this:


Starting with an API context on element 'level 2' (e.g. a context menu script), following some simple source code examples, that may help you.

level2;     // node context

english = context.getProject().getLanguage("EN");

varFormData = level2.getFormData();

fieldOne = varFormData.get(english, "mySecondVariable");


<overwritten value in level 2>

// throws NoSuchFormFieldException because variable 'myVariable' is not defined in node 'level 2' -> value is inherited

varFormData.get(english, "myVariable");    

// get a list of valid field names (in this case names of variables defined in this formData)

fieldNames = varFormData.getForm().appendEditorNames(null);

// check wether a specific variable is declared in this formdata

GomFormElement editor = varFormData.getForm().findEditor("mySecondVariable");

print(editor != null);


editor = varFormData.getForm().findEditor("myVariable");

print(editor != null);


parentFormData = level2.getParent().getFormData();

editor = parentFormData.getForm().findEditor("myVariable");

print(editor != null);


if (editor != null) {

     field = parentFormData.get(english, editor.getName().toString());


     <overwritten value in level 1>