I am getting below error::
Interface Definition: Expression evaluation error at function a!textField [line 56]: Invalid index: Cannot index property 'shippingAddress' of type Text into type
Boolean
My code is:
a!localVariables(
local!locationsList: rule!AIP_getAddress(addressId: NULL),
local!addingAddress : false(),
local!newAddress : 'type!{urn:com:appian:types:AIP}AIP_address'(),
{
a!sectionLayout(
label: "Address",
contents: {
a!radioButtonField(
label: "Radio Buttons",
labelPosition: "COLLAPSED",
choiceLabels:
a!forEach(
items: local!locationsList,
expression: fv!item.shippingAddress & " " &
if(isnull(fv!item.unitNumber), null, "Unit #" & fv!item.unitNumber)
& " " & fv!item.city & ", " & fv!item.stateOrProvince & " "
& fv!item.postalCode
),
choiceValues: local!locationsList,
value: ri!address,
saveInto: ri!address,
choiceLayout: "STACKED",
validations: {}
)
}
a!richTextDisplayField(
value: {
a!richTextIcon(
icon: "plus"
" ",
a!richTextItem(
text: {
"Add New Address"
},
link: a!dynamicLink(
label: "Dynamic Link",
value: true(),
saveInto: local!addingAddress
style: {
"STRONG"
a!boxLayout(
label: "Add New Address",
a!sideBySideLayout(
items: {
a!sideBySideItem(
item: a!textField(
label: "Shipping Address",
labelPosition: "ABOVE",
value: local!newAddress.shippingAddress,
saveInto: local!newAddress.shippingAddress,
refreshAfter: "UNFOCUS",
required: true,
label: "Unit number",
value: local!newAddress.unitNumber,
saveInto: local!newAddress. unitNumber,
label: "City",
value: local!newAddress.city,
saveInto: local!newAddress.city,
width: "2X"
label: "State/Province",
value: local!newAddress,
saveInto: local!newAddress,
width: "1X"
label: "Postal Code",
a!buttonArrayLayout(
buttons: {
a!buttonWidget(
label: "ADD",
saveInto: {
a!save(local!locationsList,append(local!locationsList,local!newAddress)),
a!save(ri!address,local!newAddress),
a!save(local!newAddress,{addreessId: null,shippingAddress:" ",unitNumber:null,city:" ",
stateOrProvince: " ",postalCode : null}),
a!save(local!addingAddress,false())
style: "PRIMARY",
validate: true
align: "END"
showWhen: local!addingAddress,
style: "ACCENT",
marginBelow: "STANDARD"
I have attached the screenshot for reference . Kindly guide me please.
Discussion posts and replies are publicly visible
Hi,
try using index function like in index(local!newAddress,"shippingAddress",null)
https://docs.appian.com/suite/help/21.4/fnc_array_index.html