Appian Community and Appian Academy are being upgraded. As a part of the upgrade, Appian Community is currently in read-only mode, and user registration is disabled until August 3. We apologize for any inconvenience this may cause, but a more secure, stable, and performant Community experience is coming soon!

The new Appian Community launches August 3, followed by Appian Academy on August 7. During the migration, Appian Community Edition, Appian Academy, Documentation, Certifications, Instructor-led Customer Training, Partner Sales Training & Accreditation, and Forum (for Appian Partners and Customers only) will remain available.

Using local variable to add a section calling another interface on a button click

Certified Associate Developer

I had created an interface that calls another interface. Also, I had created a counter as a local variable that is incremented by 1 every time a button in the interface is pressed. On every button press I want to add a new section that calls the child interface. My problem is that on the first press only the child interface appears! So here is the code if you can help me

a!localVariables(
local!count: 1,
{
a!sectionLayout(
label: "Click the button to add a new Customer Currency section",
contents: {
a!buttonArrayLayout(
buttons: {
a!buttonWidget(
label: "Add new section below",
icon: "plus-circle",
value: local!count + 1,
saveInto: local!count,
size: "SMALL",
width: "FILL",
style: "PRIMARY"
)
},
align: "START"
)

}
),
if(local!count<>1,a!sectionLayout(
label: "",
contents: {
rule!C_CustomerCurrency(ri!Currency)
}
),"")


}
)

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Senior Developer

    Try this

    a!localVariables(
    local!count: 1,
    {
    a!sectionLayout(
    label: "Click the button to add a new Customer Currency section",
    contents: {
    a!buttonArrayLayout(
    buttons: {
    a!buttonWidget(
    label: "Add new section below",
    icon: "plus-circle",
    value: local!count + 1,
    saveInto: local!count,
    size: "SMALL",
    width: "FILL",
    style: "PRIMARY"
    )
    },
    align: "START"
    )

    }
    ),
    if(local!count>0,
    a!foreach(
    items:enumerate(local!count)+1,
    expression:
    a!sectionLayout(
    label: "",
    contents: {
    a!textField(
    label:"test"
    )
    }
    )),"")


    }
    )

Reply
  • 0
    Certified Senior Developer

    Try this

    a!localVariables(
    local!count: 1,
    {
    a!sectionLayout(
    label: "Click the button to add a new Customer Currency section",
    contents: {
    a!buttonArrayLayout(
    buttons: {
    a!buttonWidget(
    label: "Add new section below",
    icon: "plus-circle",
    value: local!count + 1,
    saveInto: local!count,
    size: "SMALL",
    width: "FILL",
    style: "PRIMARY"
    )
    },
    align: "START"
    )

    }
    ),
    if(local!count>0,
    a!foreach(
    items:enumerate(local!count)+1,
    expression:
    a!sectionLayout(
    label: "",
    contents: {
    a!textField(
    label:"test"
    )
    }
    )),"")


    }
    )

Children