Try with this code It might helpful.
Option 1
a!localVariables(
local!isSelected: false,
a!sectionLayout(
label: "Select a Product",
isCollapsible: true,
contents: {
a!cardLayout(
contents: {
a!sideBySideLayout(
alignVertical: "MIDDLE",
items: {
a!sideBySideItem(
item: a!richTextDisplayField(
labelPosition: "COLLAPSED",
align: "RIGHT",
value: {
a!richTextIcon(
showWhen: not(local!isSelected),
icon: "square-o",
size: "MEDIUM",
linkStyle: "STANDALONE",
link: a!dynamicLink(
saveInto: {
a!save(local!isSelected, not(local!isSelected))
}
)
),
a!richTextIcon(
showWhen: local!isSelected,
icon: "check-square-o-alt",
size: "MEDIUM",
linkStyle: "STANDALONE",
link: a!dynamicLink(
saveInto: {
a!save(local!isSelected, not(local!isSelected))
}
)
),
char(9),
a!richTextItem(
text: "2019 Lexus ES350",
style: "STRONG",
size: "MEDIUM"
),
char(10),
a!richTextItem(
text: "Time for tire rotation"
)
}
)
)
}
)
},
height: "AUTO",
style: "ACCENT",
marginBelow: "STANDARD"
)
}
)
)
Option 2
a!localVariables(
local!isSelected: false,
a!sectionLayout(
label: "Select a Product",
isCollapsible: true,
contents: {
a!cardLayout(
contents: {
a!sideBySideLayout(
alignVertical: "MIDDLE",
items: {
a!sideBySideItem(
item: a!richTextDisplayField(
labelPosition: "COLLAPSED",
align: "LEFT",
value: {
a!richTextIcon(
showWhen: not(local!isSelected),
icon: "square-o",
size: "MEDIUM",
linkStyle: "STANDALONE",
link: a!dynamicLink(
saveInto: {
a!save(local!isSelected, not(local!isSelected))
}
)
),
a!richTextIcon(
showWhen: local!isSelected,
icon: "check-square-o-alt",
size: "MEDIUM",
linkStyle: "STANDALONE",
link: a!dynamicLink(
saveInto: {
a!save(local!isSelected, not(local!isSelected))
}
)
)
}
)
),
a!sideBySideItem(
item: a!richTextDisplayField(
labelPosition: "COLLAPSED",
align: "RIGHT",
value: {
a!richTextItem(
text: "2019 Lexus ES350",
style: "STRONG",
size: "MEDIUM"
),
char(10),
a!richTextItem(
text: "Time for tire rotation"
)
}
)
)
}
)
},
height: "AUTO",
style: "ACCENT",
marginBelow: "STANDARD"
)
}
)
)