What are you trying to accomplish
I am wanting to have a singular boolean input that alters the showIf
of numerous list items.
Desired functionality:
Builder.registerComponent(BuilderComponents.example, {
name: "example",
inputs: [
{
name: "properties",
type: "object",
subFields: [
{
name: "accessThis",
type: "boolean",
defaultValue: true,
},
],
},
{
name: "sections",
type: "list",
subFields: [
{
name: "items",
type: "list",
subFields: [
{
name: "properties",
type: "object",
subFields: [
{
name: "FromHere",
type: "boolean",
showIf: `options.get("accessThis")`
},
],
},
],
},
],
},
],
});
showIf: options.get("accessThis")
does not work like this, and options is unable to get “accessThis” from this location of the object.
You cannot use the traditional showIf functionality within nested subFields due to (options, parent, parentElements) => { }
being unable to be directly serialized and passed as an argument in a postMessage
function call.
This can be normally worked around by utilizing stringified queries like options.get("accessThis")
That however only works within the immediate scope. Is there a different current functionality to allow for accessing “accessThis” from within a nested subfield?