Skip to main content
omj2851
December 12, 2024
Solved

Create a nested list to display

  • December 12, 2024
  • 4 replies
  • 0 views

How can we create a rich text display menu as showing in the attached format having sub list too.

Best answer by stefanhelzle0001

{
  a!richTextDisplayField(
    labelPosition: "COLLAPSED",
    value: {
      a!richTextBulletedList(
        items: {
          "Item 1",
          a!richTextListItem(
            text: "Item 2",
            nestedList: a!richTextBulletedList(
              items: {"a", "b"}
            )
          ),
          a!richTextListItem(
            text: "Item 3",
            nestedList: a!richTextBulletedList(
              items: {"c", "d"}
            )
          ),
          "Item 4"
        }
      )
    }
  )
}

4 replies

stefanhelzle0001
December 12, 2024

{
  a!richTextDisplayField(
    labelPosition: "COLLAPSED",
    value: {
      a!richTextBulletedList(
        items: {
          "Item 1",
          a!richTextListItem(
            text: "Item 2",
            nestedList: a!richTextBulletedList(
              items: {"a", "b"}
            )
          ),
          a!richTextListItem(
            text: "Item 3",
            nestedList: a!richTextBulletedList(
              items: {"c", "d"}
            )
          ),
          "Item 4"
        }
      )
    }
  )
}

omj2851
omj2851Author
December 12, 2024

Hi [mention:a11f77a729fb4db2af76b09948583328:e9ed411860ed4f2ba0265705b8793d05] 

thanks so much. very close to my AC but my requirement for this code is under a foreach loop.

So i shared the updated code provided by you as per my secnario & what error i got while implementing the same.

{
a!richTextDisplayField(
labelPosition: "COLLAPSED",
value: {
a!richTextBulletedList(
items: a!forEach(
items: {
"Item1",
a!richTextListItem(
text: "item2",
nestedList: a!richTextBulletedList(items: { "a", "b" })
),
a!richTextListItem(
text: "Item 3",
nestedList: a!richTextBulletedList(items: { "c", "d" })
),
"Item 4"
},
expression: a!richTextItem(text: fv!item)
)
)
}
)
}

shivar8114
December 12, 2024

 Hi [mention:67d3e8c7ee954087ae38b3a86b2789c3:e9ed411860ed4f2ba0265705b8793d05] 

Please Use the below code which is matching your scenario

{
a!richTextDisplayField(
labelPosition: "COLLAPSED",
value: {
a!richTextBulletedList(
items: a!forEach(
items: {
"Item1",
a!richTextListItem(
text: "item2",
nestedList: a!richTextBulletedList(items: { "a", "b" })
),
a!richTextListItem(
text: "Item 3",
nestedList: a!richTextBulletedList(items: { "c", "d" })
),
"Item 4"
},
expression: fv!item
)
)
}
)
}